Skip to content

Commit dd27208

Browse files
Merge pull request linode#67 from linode/release-1.0.3
Release 1.0.3
2 parents fd1c90a + d5a6680 commit dd27208

File tree

8 files changed

+98
-20
lines changed

8 files changed

+98
-20
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@ you may need to install the Gatsby CLI as well `npm install -g gatsby-cli`
1212

1313
Check out the site at http://localhost:8000/
1414

15+
If you'd like to use a local YAML file to build the API docs, run:
16+
17+
`yarn develop [relative-path-to-your-local-YAML-file]`
18+
19+
ex: `yarn develop ../linode-api-docs/openapi.yaml`
20+
1521
### Build
1622

1723
The API documentation in this site is also indexed in Algolia, so that
1824
it can be searched across Linode's services. The scripts for this are
1925
located in the `/search` directory. In order to run them correctly,
20-
you will need to create a `.env` file in the root directory with the
26+
you will need to create a `.env` file in the root directory with the
2127
following values:
2228

2329
ALGOLIA_API_KEY=(your key here)
24-
ALGOLIA_API_SECRET=(your secret here)
30+
ALGOLIA_API_SECRET=(your secret here)

develop.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
bash ./getDependencies.sh ${1}
4+
gatsby develop;

getDependencies.sh

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,40 @@
11
BLUE='\033[0;34m'
22
NC='\033[0m' # No Color
33

4+
SPEC_FILE=""
5+
if [ -n ${1} ]; then
6+
SPEC_FILE=../${1}
7+
echo $([ -f $SPEC_FILE ])
8+
fi
9+
410
echo
5-
echo "${BLUE}Fetching base theme${NC}"
11+
printf "${BLUE}Fetching base theme${NC}\n"
612
if
713
cd linode-hugo-theme; then
814
git pull origin development; else
915
git clone https://github.com/linode/linode-hugo-theme.git;
1016
fi
1117

12-
echo
13-
echo "${BLUE}Fetching API specs${NC}"
14-
cd -
15-
curl https://raw.githubusercontent.com/linode/linode-api-docs/master/openapi.yaml > static/api/docs/v4/openapi.yaml
18+
if [ -f "$SPEC_FILE" ]; then
19+
echo
20+
printf "${BLUE}Using local spec file at: ${SPEC_FILE}${NC}\n"
21+
cat $SPEC_FILE > ../static/api/docs/v4/openapi.yaml;
22+
cd -
23+
else
24+
echo
25+
printf "${BLUE}Fetching API specs${NC}\n"
26+
cd -
27+
curl https://raw.githubusercontent.com/linode/linode-api-docs/master/openapi.yaml > static/api/docs/v4/openapi.yaml;
28+
fi
1629

1730
echo
18-
echo "${BLUE}Removing faulty data${NC}"
31+
printf "${BLUE}Removing faulty data${NC}\n"
1932
sed -i.bak '/backgroundColor:/d' static/api/docs/v4/openapi.yaml
2033
rm static/api/docs/v4/openapi.yaml.bak
2134

2235
echo
23-
echo "${BLUE}Converting YAML to JSON${NC}"
24-
./node_modules/yamljs/bin/yaml2json static/api/docs/v4/openapi.yaml > static/api/docs/v4/spec.json
36+
printf "${BLUE}Converting YAML to JSON${NC}\n"
37+
node_modules/yamljs/bin/yaml2json static/api/docs/v4/openapi.yaml > static/api/docs/v4/spec.json
38+
# some data manipulation to fix the result of the conversion above
39+
sed -i.bak 's@\\\\[[:space:]]@\\\\\\n @g' static/api/docs/v4/spec.json
40+
rm static/api/docs/v4/spec.json.bak

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
],
5151
"scripts": {
5252
"build": "./getDependencies.sh && gatsby build && node search/buildIndex.js",
53-
"develop": "./getDependencies.sh && gatsby develop",
53+
"develop": "./develop.sh",
5454
"start": "npm run develop",
5555
"serve": "gatsby serve",
5656
"test": "echo \"Write tests! -> https://gatsby.app/unit-testing\""

src/components/2_molecules/BodySchema.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { getOr } from "lodash/fp";
22
import React from "react";
33
import Markdown from "react-markdown/with-html";
44

5+
import Enum from "./Enum";
56
import Filterable from "./Filterable";
67
import Nullable from "./Nullable";
78
import SubResponse from "./SubResponse";
@@ -97,6 +98,7 @@ export const BodySchema = props => {
9798
<span className="tag tag-deprecated">Deprecated</span>
9899
</div>
99100
)}
101+
{b.enum && <Enum dataSource={b} />}
100102
<Markdown
101103
source={b.description}
102104
escapeHtml={false}

src/components/2_molecules/paramDisplay.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from "react";
2+
import Markdown from "react-markdown/with-html";
23

34
export const ParamDisplay = props => {
45
const { param } = props;
@@ -38,7 +39,15 @@ export const ParamDisplay = props => {
3839
<span className="tag tag-light">{param.schema.default}</span>
3940
</div>
4041
)}
41-
{param.description && <div>{param.description}</div>}
42+
{param.description && (
43+
<div>
44+
<Markdown
45+
source={param.description}
46+
escapeHtml={false}
47+
className="api-desc"
48+
/>
49+
</div>
50+
)}
4251
</div>
4352
</div>
4453
</div>

src/components/5_templates/api.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,26 +120,26 @@ class apiPage extends React.Component {
120120
className="my-8 api-desc"
121121
/>
122122
{m.security && <Security oauth={m.security[1].oauth} />}
123-
{m.parameters && (
123+
{n.parameters && (
124124
<div className="my-8">
125-
<h3 className="mb-2">Query Parameters</h3>
126-
{m.parameters.map((param, i) => (
125+
<h3 className="mb-2">Path Parameters</h3>
126+
{n.parameters.map((param, i) => (
127127
<ParamDisplay
128128
key={`param-item-${i}`}
129129
param={param}
130-
m={m}
130+
m={n}
131131
/>
132132
))}
133133
</div>
134134
)}
135-
{n.parameters && (
135+
{m.parameters && (
136136
<div className="my-8">
137-
<h3 className="mb-2">Path Parameters</h3>
138-
{n.parameters.map((param, i) => (
137+
<h3 className="mb-2">Query Parameters</h3>
138+
{m.parameters.map((param, i) => (
139139
<ParamDisplay
140140
key={`param-item-${i}`}
141141
param={param}
142-
m={n}
142+
m={m}
143143
/>
144144
))}
145145
</div>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: "4.4.0: 2019-09-09"
3+
date: "2019-09-09T08:00:00-04:00"
4+
description: "API Changelog 4.4.0"
5+
changelog:
6+
- API
7+
version: 4.4.0
8+
---
9+
10+
### Added
11+
12+
- Added a `secondary_entity` property to the [GET /account/events](/api/v4/account-events) and [GET /account/events/{eventId}](/api/v4/account-events-event-id) endpoints. A `secondary_entity` object displays information about an additional entity that is related to the Event. Currently, the `linode_boot`, `linode_create`, and `linode_clone` Event actions can generate a `secondary_entity` object.
13+
14+
- Added convenience Object Storage beta endpoints for the Early Access Program. It is recommended to use the more fully-featured [S3 API](https://docs.ceph.com/docs/mimic/radosgw/s3/#) directly instead of these endpoints. **Note**: these endpoints are prepended with **`/v4beta`** instead of `/v4`.
15+
16+
- List Object Storage Buckets ([GET /object-storage/buckets](/api/v4/object-storage-buckets))
17+
- Create Object Storage Bucket ([POST /object-storage/buckets](/api/v4/object-storage-buckets/#post))
18+
- View Object Storage Bucket ([GET /object-storage/buckets/{clusterId}/{bucket}](/api/v4/object-storage-buckets-cluster-id-bucket))
19+
- Remove Object Storage Bucket ([DELETE /object-storage/buckets/{clusterId}/{bucket}](/api/v4/object-storage-buckets-cluster-id-bucket/#delete))
20+
- Modify Object Storage Bucket Access ([POST /object-storage/buckets/{clusterId}/{bucket}/access](/api/v4/object-storage-buckets-cluster-id-bucket-access/#post))
21+
- List Object Storage Bucket Contents ([GET /object-storage/buckets/{clusterId}/{bucket}/object-list](/api/v4/object-storage-buckets-cluster-id-bucket-object-list))
22+
- Create Object Storage Object URL ([POST /object-storage/buckets/{clusterId}/{bucket}/object-url](/api/v4/object-storage-buckets-cluster-id-bucket-object-url/#post))
23+
24+
### Changed
25+
26+
- The `group` property of the Managed Contacts ([/managed/contacts](/api/v4/managed-contacts/#post)) resource is no longer deprecated.
27+
- The `consultation_group` property of the Managed Services ([/managed/services](/api/v4/managed-services)) resource is no longer deprecated.
28+
29+
### Fixed
30+
31+
- Previously, you could initiate a cross data center (DC) migration ([POST /linode/instances/{linodeId}/migrate](/api/v4/linode-instances-linode-id-migrate/#post)) even if the Linode already had a pending migration in the queue. Now, if your Linode has a pending migration already queued, you will not be able to initiate a DC migration until it has completed and you will receive an error response, "Linode has a pending migration." A list of pending migrations, if any, can be accessed from [GET /account/notifications](/api/v4/account-notifications ).
32+
33+
- Validation to ensure a running Linode is powered down prior to initiating a cross data center (DC) migration ([POST /linode/instances/{linodeId}/migrate](/api/v4/linode-instances-linode-id-migrate/#post)) was removed. This validation is unnecessary because a Linode is automatically powered off, migrated, and then restored to its previous boot state when any Linode migration is initiated.
34+
35+
- The `group` property of a managed contacts resource can now be updated ([PUT /managed/contacts/{contactId}](/api/v4/managed-contacts-contact-id/#put)) with a null value. Previous PUT validation generated an error when the `group` property was updated with a null value.
36+
37+
- When updating ([PUT /linode/stackscripts/{stackscriptId}](/api/v4/linode-stackscripts-stackscript-id/#put)) a StackScripts resource, the `images` property no longer accepts an empty array. Previously, there was no validation in place to prevent an empty `images` property array. This caused a StackScript to no longer be deployable.
38+
39+
- When listing Managed Services ([GET /managed/services](/api/v4/managed-services)) on a managed account, removed services no longer appear in the response data.
40+
41+
- A Managed Credential now correctly maps to a Managed Service. Previously, when you created ([POST /managed/services](/api/v4/managed-services/#post)) or updated ([PUT /managed/services/{serviceId}](/api/v4/managed-services-service-id/#put)) a Managed Service with a `credentials` parameter, its Managed Credential Ids did not appropriately map to the service. This resulted in an empty `credentials` array when listing ([GET /managed/services](/api/v4/managed-services)) or viewing ([GET /managed/services/{serviceId}](/api/v4/managed-services-service-id)) a Managed Service.

0 commit comments

Comments
 (0)