Skip to content

Commit

Permalink
Add curl examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-aaron committed Jan 7, 2025
1 parent 982efa0 commit 51b5bb5
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lang: cURL
source: |-
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"name": "test-key", "grants": [{"bucket": "test-bucket", "permission": "read"}]}' \
"https://api.digitalocean.com/v2/spaces/keys"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X DELETE \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/spaces/keys/DOACCESSKEYEXAMPLE"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/spaces/keys"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lang: cURL
source: |-
curl -X PATCH \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"name": "new-key-name"}' \
"https://api.digitalocean.com/v2/spaces/keys/DOACCESSKEYEXAMPLE"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lang: cURL
source: |-
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"name": "new-key-name"}' \
"https://api.digitalocean.com/v2/spaces/keys/DOACCESSKEYEXAMPLE"
3 changes: 3 additions & 0 deletions specification/resources/spaces/key_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ responses:
default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/spaces_key_create.yml'

security:
- bearer_auth:
- 'spaces_key:create_credentials'
3 changes: 3 additions & 0 deletions specification/resources/spaces/key_delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ responses:
default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/spaces_key_delete.yml'

security:
- bearer_auth:
- 'spaces_key:delete'
3 changes: 3 additions & 0 deletions specification/resources/spaces/key_list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ responses:
default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/spaces_key_list.yml'

security:
- bearer_auth:
- 'spaces_key:read'
3 changes: 3 additions & 0 deletions specification/resources/spaces/key_patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ responses:
default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/spaces_key_patch.yml'

security:
- bearer_auth:
- 'spaces_key:update'
3 changes: 3 additions & 0 deletions specification/resources/spaces/key_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ responses:
default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/spaces_key_update.yml'

security:
- bearer_auth:
- 'spaces_key:update'

0 comments on commit 51b5bb5

Please sign in to comment.