Skip to content

Commit

Permalink
Add examples for resources for Cloudflare (#2747)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Oct 31, 2024
1 parent b111c82 commit 7e1cfa4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-31 14:51:18.802907",
"spec_repo_commit": "e9cc5e6a"
"regenerated": "2024-10-31 15:33:09.790448",
"spec_repo_commit": "a7602fa1"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-31 14:51:18.821531",
"spec_repo_commit": "e9cc5e6a"
"regenerated": "2024-10-31 15:33:09.808736",
"spec_repo_commit": "a7602fa1"
}
}
}
15 changes: 12 additions & 3 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4527,10 +4527,13 @@ components:
example: test-name
type: string
resources:
description: An allowlist of resources to restrict pulling metrics for.
description: An allowlist of resources to restrict pulling metrics for including
`'web', 'dns', 'lb' (load balancer), 'worker'`.
example:
- web
- dns
- lb
- worker
items:
type: string
type: array
Expand Down Expand Up @@ -4575,10 +4578,13 @@ components:
example: test-name
type: string
resources:
description: An allowlist of resources to restrict pulling metrics for.
description: An allowlist of resources to restrict pulling metrics for including
`'web', 'dns', 'lb' (load balancer), 'worker'`.
example:
- web
- dns
- lb
- worker
items:
type: string
type: array
Expand Down Expand Up @@ -4642,10 +4648,13 @@ components:
description: The name of the Cloudflare account.
type: string
resources:
description: An allowlist of resources to restrict pulling metrics for.
description: An allowlist of resources to restrict pulling metrics for including
`'web', 'dns', 'lb' (load balancer), 'worker'`.
example:
- web
- dns
- lb
- worker
items:
type: string
type: array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type CloudflareAccountCreateRequestAttributes struct {
Email *string `json:"email,omitempty"`
// The name of the Cloudflare account.
Name string `json:"name"`
// An allowlist of resources to restrict pulling metrics for.
// An allowlist of resources to restrict pulling metrics for including `'web', 'dns', 'lb' (load balancer), 'worker'`.
Resources []string `json:"resources,omitempty"`
// An allowlist of zones to restrict pulling metrics for.
Zones []string `json:"zones,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type CloudflareAccountResponseAttributes struct {
Email *string `json:"email,omitempty"`
// The name of the Cloudflare account.
Name string `json:"name"`
// An allowlist of resources to restrict pulling metrics for.
// An allowlist of resources to restrict pulling metrics for including `'web', 'dns', 'lb' (load balancer), 'worker'`.
Resources []string `json:"resources,omitempty"`
// An allowlist of zones to restrict pulling metrics for.
Zones []string `json:"zones,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type CloudflareAccountUpdateRequestAttributes struct {
Email *string `json:"email,omitempty"`
// The name of the Cloudflare account.
Name *string `json:"name,omitempty"`
// An allowlist of resources to restrict pulling metrics for.
// An allowlist of resources to restrict pulling metrics for including `'web', 'dns', 'lb' (load balancer), 'worker'`.
Resources []string `json:"resources,omitempty"`
// An allowlist of zones to restrict pulling metrics for.
Zones []string `json:"zones,omitempty"`
Expand Down
8 changes: 4 additions & 4 deletions tests/scenarios/features/v2/cloudflare_integration.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Feature: Cloudflare Integration
@generated @skip @team:DataDog/saas-integrations
Scenario: Add Cloudflare account returns "Bad Request" response
Given new "CreateCloudflareAccount" request
And body with value {"data": {"attributes": {"api_key": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", "email": "test-email@example.com", "name": "test-name", "resources": ["web", "dns"], "zones": ["zone_id_1", "zone_id_2"]}, "type": "cloudflare-accounts"}}
And body with value {"data": {"attributes": {"api_key": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", "email": "test-email@example.com", "name": "test-name", "resources": ["web", "dns", "lb", "worker"], "zones": ["zone_id_1", "zone_id_2"]}, "type": "cloudflare-accounts"}}
When the request is sent
Then the response status is 400 Bad Request

Expand Down Expand Up @@ -44,7 +44,7 @@ Feature: Cloudflare Integration
@generated @skip @team:DataDog/saas-integrations
Scenario: Add Cloudflare account returns "Not Found" response
Given new "CreateCloudflareAccount" request
And body with value {"data": {"attributes": {"api_key": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", "email": "test-email@example.com", "name": "test-name", "resources": ["web", "dns"], "zones": ["zone_id_1", "zone_id_2"]}, "type": "cloudflare-accounts"}}
And body with value {"data": {"attributes": {"api_key": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", "email": "test-email@example.com", "name": "test-name", "resources": ["web", "dns", "lb", "worker"], "zones": ["zone_id_1", "zone_id_2"]}, "type": "cloudflare-accounts"}}
When the request is sent
Then the response status is 404 Not Found

Expand Down Expand Up @@ -118,7 +118,7 @@ Feature: Cloudflare Integration
Scenario: Update Cloudflare account returns "Bad Request" response
Given new "UpdateCloudflareAccount" request
And request contains "account_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"api_key": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", "email": "test-email@example.com", "resources": ["web", "dns"], "zones": ["zone_id_1", "zone_id_2"]}, "type": "cloudflare-accounts"}}
And body with value {"data": {"attributes": {"api_key": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", "email": "test-email@example.com", "resources": ["web", "dns", "lb", "worker"], "zones": ["zone_id_1", "zone_id_2"]}, "type": "cloudflare-accounts"}}
When the request is sent
Then the response status is 400 Bad Request

Expand All @@ -144,7 +144,7 @@ Feature: Cloudflare Integration
Scenario: Update Cloudflare account returns "Not Found" response
Given new "UpdateCloudflareAccount" request
And request contains "account_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"api_key": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", "email": "test-email@example.com", "resources": ["web", "dns"], "zones": ["zone_id_1", "zone_id_2"]}, "type": "cloudflare-accounts"}}
And body with value {"data": {"attributes": {"api_key": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", "email": "test-email@example.com", "resources": ["web", "dns", "lb", "worker"], "zones": ["zone_id_1", "zone_id_2"]}, "type": "cloudflare-accounts"}}
When the request is sent
Then the response status is 404 Not Found

Expand Down

0 comments on commit 7e1cfa4

Please sign in to comment.