Skip to content

Commit

Permalink
[Synthetics] Add create, edit and delete endpoints for global variabl…
Browse files Browse the repository at this point in the history
…es (#421)

* [Synthetics] Add global variable endpoint tests

* Update tests/api/v1/datadog/api_synthetics_test.go

Co-authored-by: Jiri Kuncar <jiri.kuncar@datadoghq.com>

* [Synthetics] Fix missing tags

* [Synthetics] Update tests with new endpoints

* [Synthetics] Fix global variable creation

* Regenerate client from commit 049bffd of spec repo

* Fix test

Co-authored-by: Romain Berger <romain.berger@datadoghq.com>
Co-authored-by: Romain Berger <romain@romainberger.com>
Co-authored-by: Jiri Kuncar <jiri.kuncar@datadoghq.com>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
Co-authored-by: Thomas Hervé <thomas.herve@datadoghq.com>
  • Loading branch information
6 people authored Jul 31, 2020
1 parent 65ca3d5 commit 4099375
Show file tree
Hide file tree
Showing 15 changed files with 1,744 additions and 6 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.2.0",
"regenerated": "2020-07-30 15:13:16.740261",
"spec_repo_commit": "a7ab9d2"
"regenerated": "2020-07-31 08:09:16.579146",
"spec_repo_commit": "049bffd"
},
"v2": {
"apigentools_version": "1.2.0",
"regenerated": "2020-07-30 15:13:22.348328",
"spec_repo_commit": "a7ab9d2"
"regenerated": "2020-07-31 08:09:21.963297",
"spec_repo_commit": "049bffd"
}
}
}
4 changes: 4 additions & 0 deletions api/v1/datadog/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ docs/SyntheticsDeviceID.md
docs/SyntheticsErrorCode.md
docs/SyntheticsGetAPITestLatestResultsResponse.md
docs/SyntheticsGetBrowserTestLatestResultsResponse.md
docs/SyntheticsGlobalVariable.md
docs/SyntheticsGlobalVariableValue.md
docs/SyntheticsListTestsResponse.md
docs/SyntheticsLocation.md
docs/SyntheticsLocations.md
Expand Down Expand Up @@ -712,6 +714,8 @@ model_synthetics_device_id.go
model_synthetics_error_code.go
model_synthetics_get_api_test_latest_results_response.go
model_synthetics_get_browser_test_latest_results_response.go
model_synthetics_global_variable.go
model_synthetics_global_variable_value.go
model_synthetics_list_tests_response.go
model_synthetics_location.go
model_synthetics_locations.go
Expand Down
5 changes: 5 additions & 0 deletions api/v1/datadog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,11 @@ Class | Method | HTTP request | Description
*ServiceLevelObjectivesApi* | [**ListSLOs**](docs/ServiceLevelObjectivesApi.md#listslos) | **Get** /api/v1/slo | Search SLOs
*ServiceLevelObjectivesApi* | [**UpdateSLO**](docs/ServiceLevelObjectivesApi.md#updateslo) | **Put** /api/v1/slo/{slo_id} | Update a SLO
*SnapshotsApi* | [**GetGraphSnapshot**](docs/SnapshotsApi.md#getgraphsnapshot) | **Get** /api/v1/graph/snapshot | Take graph snapshots
*SyntheticsApi* | [**CreateGlobalVariable**](docs/SyntheticsApi.md#createglobalvariable) | **Post** /api/v1/synthetics/variables | Create a global variable
*SyntheticsApi* | [**CreateTest**](docs/SyntheticsApi.md#createtest) | **Post** /api/v1/synthetics/tests | Create a test
*SyntheticsApi* | [**DeleteGlobalVariable**](docs/SyntheticsApi.md#deleteglobalvariable) | **Delete** /api/v1/synthetics/variables/{variable_id} | Delete a global variable
*SyntheticsApi* | [**DeleteTests**](docs/SyntheticsApi.md#deletetests) | **Post** /api/v1/synthetics/tests/delete | Delete tests
*SyntheticsApi* | [**EditGlobalVariable**](docs/SyntheticsApi.md#editglobalvariable) | **Put** /api/v1/synthetics/variables/{variable_id} | Edit a global variable
*SyntheticsApi* | [**GetAPITestLatestResults**](docs/SyntheticsApi.md#getapitestlatestresults) | **Get** /api/v1/synthetics/tests/{public_id}/results | Get the test&#39;s latest results summaries (API)
*SyntheticsApi* | [**GetAPITestResult**](docs/SyntheticsApi.md#getapitestresult) | **Get** /api/v1/synthetics/tests/{public_id}/results/{result_id} | Get a test result (API)
*SyntheticsApi* | [**GetBrowserTest**](docs/SyntheticsApi.md#getbrowsertest) | **Get** /api/v1/synthetics/tests/browser/{public_id} | Get a test configuration (browser)
Expand Down Expand Up @@ -478,6 +481,8 @@ Class | Method | HTTP request | Description
- [SyntheticsErrorCode](docs/SyntheticsErrorCode.md)
- [SyntheticsGetAPITestLatestResultsResponse](docs/SyntheticsGetAPITestLatestResultsResponse.md)
- [SyntheticsGetBrowserTestLatestResultsResponse](docs/SyntheticsGetBrowserTestLatestResultsResponse.md)
- [SyntheticsGlobalVariable](docs/SyntheticsGlobalVariable.md)
- [SyntheticsGlobalVariableValue](docs/SyntheticsGlobalVariableValue.md)
- [SyntheticsListTestsResponse](docs/SyntheticsListTestsResponse.md)
- [SyntheticsLocation](docs/SyntheticsLocation.md)
- [SyntheticsLocations](docs/SyntheticsLocations.md)
Expand Down
164 changes: 164 additions & 0 deletions api/v1/datadog/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5038,6 +5038,119 @@ paths:
tags:
- Synthetics
x-codegen-request-body-name: body
/api/v1/synthetics/variables:
post:
description: Create a Synthetics global variable.
operationId: CreateGlobalVariable
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SyntheticsGlobalVariable'
description: Details of the global variable to create.
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/SyntheticsGlobalVariable'
description: OK
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Invalid request
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden
summary: Create a global variable
tags:
- Synthetics
x-codegen-request-body-name: body
/api/v1/synthetics/variables/{variable_id}:
delete:
description: Delete a Synthetics global variable.
operationId: DeleteGlobalVariable
parameters:
- description: The ID of the global variable.
explode: false
in: path
name: variable_id
required: true
schema:
type: string
style: simple
responses:
"200":
description: OK
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: JSON format is wrong
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden
"404":
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Not found
summary: Delete a global variable
tags:
- Synthetics
put:
description: Edit a Synthetics global variable.
operationId: EditGlobalVariable
parameters:
- description: The ID of the global variable.
explode: false
in: path
name: variable_id
required: true
schema:
type: string
style: simple
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SyntheticsGlobalVariable'
description: Details of the global variable to update.
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/SyntheticsGlobalVariable'
description: OK
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Invalid request
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden
summary: Edit a global variable
tags:
- Synthetics
x-codegen-request-body-name: body
/api/v1/tags/hosts:
get:
description: Return a mapping of tags to hosts for your whole infrastructure.
Expand Down Expand Up @@ -13323,6 +13436,57 @@ components:
$ref: '#/components/schemas/SyntheticsBrowserTestResultShort'
type: array
type: object
SyntheticsGlobalVariable:
description: Synthetics global variable.
example:
name: name
description: description
id: id
value:
secure: true
value: value
tags:
- tags
- tags
properties:
description:
description: Description of the global variable.
type: string
id:
description: Unique identifier of the global variable.
readOnly: true
type: string
name:
description: Name of the global variable.
type: string
tags:
description: Tags of the global variable.
items:
description: Tag name.
type: string
type: array
value:
$ref: '#/components/schemas/SyntheticsGlobalVariableValue'
required:
- description
- name
- tags
- value
type: object
SyntheticsGlobalVariableValue:
description: Value of the global variable.
example:
secure: true
value: value
properties:
secure:
description: Determines if the variable is secure.
type: boolean
value:
description: Value of the global variable.
type: string
required:
- value
SyntheticsListTestsResponse:
description: Object containing an array of Synthetic tests configuration.
example:
Expand Down
Loading

0 comments on commit 4099375

Please sign in to comment.