diff --git a/specification/resources/firewalls/firewalls_add_tags.yml b/specification/resources/firewalls/firewalls_add_tags.yml index 6fec85907..c1e8e5f6b 100644 --- a/specification/resources/firewalls/firewalls_add_tags.yml +++ b/specification/resources/firewalls/firewalls_add_tags.yml @@ -15,7 +15,7 @@ tags: - Firewalls parameters: - - $ref: 'parameters.yml#/firewall_id' + - $ref: "parameters.yml#/firewall_id" requestBody: content: @@ -24,7 +24,7 @@ requestBody: properties: tags: allOf: - - $ref: '../../shared/attributes/tags_array.yml' + - $ref: "../../shared/attributes/existing_tags_array.yml" - description: >- An array containing the names of the Tags to be assigned to the firewall. @@ -37,33 +37,33 @@ requestBody: - frontend responses: - '204': - $ref: '../../shared/responses/no_content.yml' + "204": + $ref: "../../shared/responses/no_content.yml" - '400': - $ref: '../../shared/responses/bad_request.yml' + "400": + $ref: "../../shared/responses/bad_request.yml" - '401': - $ref: '../../shared/responses/unauthorized.yml' + "401": + $ref: "../../shared/responses/unauthorized.yml" - '404': - $ref: '../../shared/responses/not_found.yml' + "404": + $ref: "../../shared/responses/not_found.yml" - '429': - $ref: '../../shared/responses/too_many_requests.yml' + "429": + $ref: "../../shared/responses/too_many_requests.yml" - '500': - $ref: '../../shared/responses/server_error.yml' + "500": + $ref: "../../shared/responses/server_error.yml" default: - $ref: '../../shared/responses/unexpected_error.yml' + $ref: "../../shared/responses/unexpected_error.yml" x-codeSamples: - - $ref: 'examples/curl/firewalls_add_tags.yml' - - $ref: 'examples/go/firewalls_add_tags.yml' - - $ref: 'examples/ruby/firewalls_add_tags.yml' - - $ref: 'examples/python/firewalls_add_tags.yml' + - $ref: "examples/curl/firewalls_add_tags.yml" + - $ref: "examples/go/firewalls_add_tags.yml" + - $ref: "examples/ruby/firewalls_add_tags.yml" + - $ref: "examples/python/firewalls_add_tags.yml" security: - bearer_auth: - - 'firewall:update' + - "firewall:update" diff --git a/specification/resources/firewalls/firewalls_delete_tags.yml b/specification/resources/firewalls/firewalls_delete_tags.yml index 5bd1d3e4f..c27b3b23e 100644 --- a/specification/resources/firewalls/firewalls_delete_tags.yml +++ b/specification/resources/firewalls/firewalls_delete_tags.yml @@ -15,7 +15,7 @@ tags: - Firewalls parameters: - - $ref: 'parameters.yml#/firewall_id' + - $ref: "parameters.yml#/firewall_id" requestBody: content: @@ -24,7 +24,7 @@ requestBody: properties: tags: allOf: - - $ref: '../../shared/attributes/tags_array.yml' + - $ref: "../../shared/attributes/existing_tags_array.yml" - description: >- An array containing the names of the Tags to be removed from the firewall. @@ -37,33 +37,33 @@ requestBody: - frontend responses: - '204': - $ref: '../../shared/responses/no_content.yml' + "204": + $ref: "../../shared/responses/no_content.yml" - '400': - $ref: '../../shared/responses/bad_request.yml' + "400": + $ref: "../../shared/responses/bad_request.yml" - '401': - $ref: '../../shared/responses/unauthorized.yml' + "401": + $ref: "../../shared/responses/unauthorized.yml" - '404': - $ref: '../../shared/responses/not_found.yml' + "404": + $ref: "../../shared/responses/not_found.yml" - '429': - $ref: '../../shared/responses/too_many_requests.yml' + "429": + $ref: "../../shared/responses/too_many_requests.yml" - '500': - $ref: '../../shared/responses/server_error.yml' + "500": + $ref: "../../shared/responses/server_error.yml" default: - $ref: '../../shared/responses/unexpected_error.yml' + $ref: "../../shared/responses/unexpected_error.yml" x-codeSamples: - - $ref: 'examples/curl/firewalls_delete_tags.yml' - - $ref: 'examples/go/firewalls_delete_tags.yml' - - $ref: 'examples/ruby/firewalls_delete_tags.yml' - - $ref: 'examples/python/firewalls_delete_tags.yml' + - $ref: "examples/curl/firewalls_delete_tags.yml" + - $ref: "examples/go/firewalls_delete_tags.yml" + - $ref: "examples/ruby/firewalls_delete_tags.yml" + - $ref: "examples/python/firewalls_delete_tags.yml" security: - bearer_auth: - - 'firewall:update' + - "firewall:update" diff --git a/specification/resources/firewalls/models/firewall.yml b/specification/resources/firewalls/models/firewall.yml index 6be23a8bb..821b75121 100644 --- a/specification/resources/firewalls/models/firewall.yml +++ b/specification/resources/firewalls/models/firewall.yml @@ -28,7 +28,7 @@ allOf: A time value given in ISO8601 combined date and time format that represents when the firewall was created. readOnly: true - example: '2020-05-23T21:24:00Z' + example: "2020-05-23T21:24:00Z" pending_changes: type: array @@ -78,9 +78,9 @@ allOf: tags: allOf: - - $ref: '../../../shared/attributes/tags_array.yml' + - $ref: "../../../shared/attributes/existing_tags_array.yml" - description: >- An array containing the names of the Tags assigned to the firewall. example: gateway - - $ref: 'firewall_rule.yml#/firewall_rules' \ No newline at end of file + - $ref: "firewall_rule.yml#/firewall_rules" diff --git a/specification/resources/firewalls/models/firewall_rule.yml b/specification/resources/firewalls/models/firewall_rule.yml index deb5512e0..3535b5a93 100644 --- a/specification/resources/firewalls/models/firewall_rule.yml +++ b/specification/resources/firewalls/models/firewall_rule.yml @@ -20,7 +20,7 @@ firewall_rule_base: containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0". - example: '8000' + example: "8000" required: - protocol @@ -39,8 +39,8 @@ firewall_rule_target: An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. example: - - '1.2.3.4' - - '18.0.0.0/8' + - "1.2.3.4" + - "18.0.0.0/8" droplet_ids: type: array @@ -74,7 +74,7 @@ firewall_rule_target: tags: allOf: - - $ref: '../../../shared/attributes/tags_array.yml' + - $ref: "../../../shared/attributes/existing_tags_array.yml" - description: >- An array containing the names of Tags corresponding to groups of Droplets to which the firewall will allow traffic. @@ -90,11 +90,11 @@ firewall_rules: type: array items: allOf: - - $ref: '#/firewall_rule_base' + - $ref: "#/firewall_rule_base" - properties: sources: allOf: - - $ref: '#/firewall_rule_target' + - $ref: "#/firewall_rule_target" - description: >- An object specifying locations from which inbound traffic will be accepted. @@ -106,11 +106,11 @@ firewall_rules: type: array items: allOf: - - $ref: '#/firewall_rule_base' + - $ref: "#/firewall_rule_base" - properties: destinations: allOf: - - $ref: '#/firewall_rule_target' + - $ref: "#/firewall_rule_target" - description: >- An object specifying locations to which outbound traffic that will be allowed. diff --git a/specification/resources/tags/examples/python/tags_create.yml b/specification/resources/tags/examples/python/tags_create.yml index 86bad4b2e..0f4109830 100644 --- a/specification/resources/tags/examples/python/tags_create.yml +++ b/specification/resources/tags/examples/python/tags_create.yml @@ -5,28 +5,6 @@ source: |- client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) - req = { - "tag": { - "name": "extra-awesome", - "resources": { - "count": 0, - "droplets": { - "count": 0 - }, - "images": { - "count": 0 - }, - "volumes": { - "count": 0 - }, - "volume_snapshots": { - "count": 0 - }, - "databases": { - "count": 0 - } - } - } - } + req = {"name": "extra-awesome"} resp = client.tags.create(body=req) diff --git a/specification/shared/attributes/existing_tags_array.yml b/specification/shared/attributes/existing_tags_array.yml new file mode 100644 index 000000000..28c77d7da --- /dev/null +++ b/specification/shared/attributes/existing_tags_array.yml @@ -0,0 +1,10 @@ +type: array +items: + type: string +nullable: true +description: >- + A flat array of tag names as strings to be applied to the resource. + Tag names must exist in order to be referenced in a request. +example: + - base-image + - prod diff --git a/specification/shared/attributes/tags_array.yml b/specification/shared/attributes/tags_array.yml index a4f8c59ce..8243341c7 100644 --- a/specification/shared/attributes/tags_array.yml +++ b/specification/shared/attributes/tags_array.yml @@ -7,4 +7,4 @@ description: >- Tag names may be for either existing or new tags. example: - base-image - - prod \ No newline at end of file + - prod