Skip to content

brk: param changes to POST /networking/ips and /linode/instances/:id/ips #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions src/data/endpoints/linodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -869,23 +869,27 @@ endpoints:
money: true
oauth: linodes:modify
description: >
Allocates a new IP Address for this Linode.
Allocates a new IPv4 Address for this Linode.
params:
type:
description: >
The type of IP Address this is, can be one of "public" or "private".
Public IP Addresses, over and above the one included with each Linode,
incur an additional monthly charge. If you need an additional Public IP Address
you must request one - please open a ticket.
type: String
value: private
description: >
The type of IP to allocate. Currently only "ipv4" is supported.
value: ipv4
public:
type: Boolean
description: >
Whether this is a public or private IP address.
Public IP Addresses, over and above the one included with each
Linode, incur an additional monthly charge. If you need an
additional Public IP Address you must request one - please
open a ticket.
value: true
examples:
curl: |
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d '{
"type": "private"
}' \
-X POST -d '{"type": "ipv4", "public":true}' \
https://$api_root/$version/linode/instances/$linode_id/ips
/linode/instances/$id/ips/$ip_address:
group: IPs
Expand Down
20 changes: 16 additions & 4 deletions src/data/endpoints/networking.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,36 @@ endpoints:
curl -H "Authorization: Bearer $TOKEN" \
https://$api_root/$version/networking/ips
POST:
response: ipaddress
money: true
oauth: ips:create
description: >
Create a new Public IPv4 Address.
Create a new IPv4 Address.
params:
type:
type: String
description: >
The type of IP to allocate. Currently only "ipv4" is supported.
The type of IP to allocate. Currently only "ipv4" is supported.
value: ipv4
public:
type: Boolean
description: >
Whether this is a public or private IP address.
Public IP Addresses, over and above the one included with each
Linode, incur an additional monthly charge. If you need an
additional Public IP Address you must request one - please
open a ticket.
value: true
linode_id:
type: Integer
description: >
The Linode ID to assign this IP to.
type: Integer
value: 123
examples:
curl: |
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d '{"type":"ipv4","linode":123}' \
-X POST -d '{"type":"ipv4", "public":true, "linode":123}' \
https://$api_root/$version/networking/ips
/networking/ips/$address:
group: IPs
Expand Down
15 changes: 9 additions & 6 deletions src/data/objects/ipaddress.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: IP Address
description: >
An IP Address
An IPv4 Address
schema:
address:
type: String
Expand All @@ -26,16 +26,19 @@ schema:
region:
type: String
value: us-east
description: The region this IP is in.
description: The Region this IP is in.
subnet_mask:
type: String
value: 255.255.255.0
description: The subnet mask.
public:
type: Boolean
value: true
description: Whether this is a public or private IP address.
type:
type: Enum
subtype: IPAddressType
value: public
description: The type of IP Address, either public or private.
type: String
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably still be an Enum of ipv4, ipv6, ipv6/range, and ipv6/pool, but I don't feel that strongly about it.

description: The type of IP Address.
value: ipv4
enums:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This enum is now irrelevant - I'd change is as described above, but it could also be removed

IPAddressType:
public: Public IP Address.
Expand Down
42 changes: 42 additions & 0 deletions src/data/objects/ipaddressv6linklocal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: IP Address
description: >
An IPv6 Address - link_local
schema:
address:
type: String
value: fe80::f03c:91ff:fe24:3a2f
description: The IP Address.
gateway:
type: String
value: fe80::1
description: The default gateway.
linode_id:
type: Integer
value: 42
description: The Linode this IP is associated with.
prefix:
type: String
value: 64
description: The network prefix.
rdns:
editable: true
type: String
value: null
description: Reverse DNS address for this IP Address. Null to reset.
region:
type: String
value: us-east
description: The Region this IP is in.
subnet_mask:
type: String
value: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
description: The subnet mask.
public:
type: Boolean
value: false
description: Whether this is a public or private IP address.
type:
type: String
description: The type of IP Address.
value: ipv6

42 changes: 42 additions & 0 deletions src/data/objects/ipaddressv6slaac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: IP Address
description: >
An IPv6 Address - slaac
schema:
address:
type: String
value: 2600:3c03::f03c:91ff:fe24:3a2f
description: The IP Address.
gateway:
type: String
value: fe80::1
description: The default gateway.
linode_id:
type: Integer
value: 42
description: The Linode this IP is associated with.
prefix:
type: String
value: 64
description: The network prefix.
rdns:
editable: true
type: String
value: "example.org"
description: Reverse DNS address for this IP Address. Null to reset.
region:
type: String
value: us-east
description: The Region this IP is in.
subnet_mask:
type: String
value: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
description: The subnet mask.
public:
type: Boolean
value: true
description: Whether this is a public or private IP address.
type:
type: String
description: The type of IP Address.
value: ipv6

5 changes: 2 additions & 3 deletions src/data/objects/linodenetworking.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ schema:
ipv6:
description: The Linode's IPv6 networking data.
slaac:
type: ipaddress
type: ipaddressv6slaac
description: >
This Linode's SLAAC range.
link_local:
type: String
value: f300::f03c:91ff:fe96:46da
type: ipaddressv6linklocal
description: >
This Linode's link-local range.
global:
Expand Down