diff --git a/.apigentools-info b/.apigentools-info index dc39df81c1..352f64aaea 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev2", - "regenerated": "2021-03-01 15:48:05.906838", - "spec_repo_commit": "46cbd6f" + "regenerated": "2021-03-02 15:02:23.452183", + "spec_repo_commit": "12c0486" }, "v2": { "apigentools_version": "1.4.1.dev2", - "regenerated": "2021-03-01 15:48:43.449211", - "spec_repo_commit": "46cbd6f" + "regenerated": "2021-03-02 15:03:02.919226", + "spec_repo_commit": "12c0486" } } } \ No newline at end of file diff --git a/docs/v1/README.md b/docs/v1/README.md index b4fdabb127..17e88d5f63 100644 --- a/docs/v1/README.md +++ b/docs/v1/README.md @@ -218,6 +218,8 @@ Class | Method | HTTP request | Description *SnapshotsApi* | [**get_graph_snapshot**](SnapshotsApi.md#get_graph_snapshot) | **GET** /api/v1/graph/snapshot | Take graph snapshots *SyntheticsApi* | [**create_global_variable**](SyntheticsApi.md#create_global_variable) | **POST** /api/v1/synthetics/variables | Create a global variable *SyntheticsApi* | [**create_private_location**](SyntheticsApi.md#create_private_location) | **POST** /api/v1/synthetics/private-locations | Create a private location +*SyntheticsApi* | [**create_synthetics_api_test**](SyntheticsApi.md#create_synthetics_api_test) | **POST** /api/v1/synthetics/tests/api | Create an API test +*SyntheticsApi* | [**create_synthetics_browser_test**](SyntheticsApi.md#create_synthetics_browser_test) | **POST** /api/v1/synthetics/tests/browser | Create a browser test *SyntheticsApi* | [**create_test**](SyntheticsApi.md#create_test) | **POST** /api/v1/synthetics/tests | Create a test *SyntheticsApi* | [**delete_global_variable**](SyntheticsApi.md#delete_global_variable) | **DELETE** /api/v1/synthetics/variables/{variable_id} | Delete a global variable *SyntheticsApi* | [**delete_private_location**](SyntheticsApi.md#delete_private_location) | **DELETE** /api/v1/synthetics/private-locations/{location_id} | Delete a private location @@ -234,6 +236,8 @@ Class | Method | HTTP request | Description *SyntheticsApi* | [**list_locations**](SyntheticsApi.md#list_locations) | **GET** /api/v1/synthetics/locations | Get all locations (public and private) *SyntheticsApi* | [**list_tests**](SyntheticsApi.md#list_tests) | **GET** /api/v1/synthetics/tests | Get the list of all tests *SyntheticsApi* | [**trigger_ci_tests**](SyntheticsApi.md#trigger_ci_tests) | **POST** /api/v1/synthetics/tests/trigger/ci | Trigger some Synthetics tests for CI +*SyntheticsApi* | [**update_api_test**](SyntheticsApi.md#update_api_test) | **PUT** /api/v1/synthetics/tests/api/{public_id} | Edit an API test +*SyntheticsApi* | [**update_browser_test**](SyntheticsApi.md#update_browser_test) | **PUT** /api/v1/synthetics/tests/browser/{public_id} | Edit a browser test *SyntheticsApi* | [**update_private_location**](SyntheticsApi.md#update_private_location) | **PUT** /api/v1/synthetics/private-locations/{location_id} | Edit a private location *SyntheticsApi* | [**update_test**](SyntheticsApi.md#update_test) | **PUT** /api/v1/synthetics/tests/{public_id} | Edit a test *SyntheticsApi* | [**update_test_pause_status**](SyntheticsApi.md#update_test_pause_status) | **PUT** /api/v1/synthetics/tests/{public_id}/status | Pause or start a test @@ -558,11 +562,14 @@ Class | Method | HTTP request | Description - [SlackIntegrationChannel](SlackIntegrationChannel.md) - [SlackIntegrationChannelDisplay](SlackIntegrationChannelDisplay.md) - [SlackIntegrationChannels](SlackIntegrationChannels.md) + - [SyntheticsAPITest](SyntheticsAPITest.md) + - [SyntheticsAPITestConfig](SyntheticsAPITestConfig.md) - [SyntheticsAPITestResultData](SyntheticsAPITestResultData.md) - [SyntheticsAPITestResultFull](SyntheticsAPITestResultFull.md) - [SyntheticsAPITestResultFullCheck](SyntheticsAPITestResultFullCheck.md) - [SyntheticsAPITestResultShort](SyntheticsAPITestResultShort.md) - [SyntheticsAPITestResultShortResult](SyntheticsAPITestResultShortResult.md) + - [SyntheticsAPITestType](SyntheticsAPITestType.md) - [SyntheticsAssertion](SyntheticsAssertion.md) - [SyntheticsAssertionJSONPathOperator](SyntheticsAssertionJSONPathOperator.md) - [SyntheticsAssertionJSONPathTarget](SyntheticsAssertionJSONPathTarget.md) @@ -573,11 +580,14 @@ Class | Method | HTTP request | Description - [SyntheticsBasicAuth](SyntheticsBasicAuth.md) - [SyntheticsBrowserError](SyntheticsBrowserError.md) - [SyntheticsBrowserErrorType](SyntheticsBrowserErrorType.md) + - [SyntheticsBrowserTest](SyntheticsBrowserTest.md) + - [SyntheticsBrowserTestConfig](SyntheticsBrowserTestConfig.md) - [SyntheticsBrowserTestResultData](SyntheticsBrowserTestResultData.md) - [SyntheticsBrowserTestResultFull](SyntheticsBrowserTestResultFull.md) - [SyntheticsBrowserTestResultFullCheck](SyntheticsBrowserTestResultFullCheck.md) - [SyntheticsBrowserTestResultShort](SyntheticsBrowserTestResultShort.md) - [SyntheticsBrowserTestResultShortResult](SyntheticsBrowserTestResultShortResult.md) + - [SyntheticsBrowserTestType](SyntheticsBrowserTestType.md) - [SyntheticsBrowserVariable](SyntheticsBrowserVariable.md) - [SyntheticsBrowserVariableType](SyntheticsBrowserVariableType.md) - [SyntheticsCITest](SyntheticsCITest.md) diff --git a/docs/v1/SyntheticsAPITest.md b/docs/v1/SyntheticsAPITest.md new file mode 100644 index 0000000000..b3888d71d3 --- /dev/null +++ b/docs/v1/SyntheticsAPITest.md @@ -0,0 +1,21 @@ +# SyntheticsAPITest + +Object containing details about a Synthetic API test. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**SyntheticsAPITestConfig**](SyntheticsAPITestConfig.md) | | [optional] +**locations** | **[str]** | Array of locations used to run the test. | [optional] +**message** | **str** | Notification message associated with the test. | [optional] +**monitor_id** | **int** | The associated monitor ID. | [optional] +**name** | **str** | Name of the test. | [optional] +**options** | [**SyntheticsTestOptions**](SyntheticsTestOptions.md) | | [optional] +**public_id** | **str** | The public ID for the test. | [optional] +**status** | [**SyntheticsTestPauseStatus**](SyntheticsTestPauseStatus.md) | | [optional] +**subtype** | [**SyntheticsTestDetailsSubType**](SyntheticsTestDetailsSubType.md) | | [optional] +**tags** | **[str]** | Array of tags attached to the test. | [optional] +**type** | [**SyntheticsAPITestType**](SyntheticsAPITestType.md) | | [optional] + +[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) + + diff --git a/docs/v1/SyntheticsAPITestConfig.md b/docs/v1/SyntheticsAPITestConfig.md new file mode 100644 index 0000000000..e193de1ee0 --- /dev/null +++ b/docs/v1/SyntheticsAPITestConfig.md @@ -0,0 +1,13 @@ +# SyntheticsAPITestConfig + +Configuration object for a Synthetic API test. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request** | [**SyntheticsTestRequest**](SyntheticsTestRequest.md) | | +**assertions** | [**[SyntheticsAssertion]**](SyntheticsAssertion.md) | Array of assertions used for the test. | defaults to [] +**config_variables** | [**[SyntheticsConfigVariable]**](SyntheticsConfigVariable.md) | Array of variables used for the test. | [optional] + +[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) + + diff --git a/docs/v1/SyntheticsAPITestType.md b/docs/v1/SyntheticsAPITestType.md new file mode 100644 index 0000000000..3332e86ce0 --- /dev/null +++ b/docs/v1/SyntheticsAPITestType.md @@ -0,0 +1,11 @@ +# SyntheticsAPITestType + +Type of the Synthetic test, `api`. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Type of the Synthetic test, `api`. | defaults to "api", must be one of ["api", ] + +[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) + + diff --git a/docs/v1/SyntheticsApi.md b/docs/v1/SyntheticsApi.md index dcfd53ed81..bbbd2eabb9 100644 --- a/docs/v1/SyntheticsApi.md +++ b/docs/v1/SyntheticsApi.md @@ -6,6 +6,8 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**create_global_variable**](SyntheticsApi.md#create_global_variable) | **POST** /api/v1/synthetics/variables | Create a global variable [**create_private_location**](SyntheticsApi.md#create_private_location) | **POST** /api/v1/synthetics/private-locations | Create a private location +[**create_synthetics_api_test**](SyntheticsApi.md#create_synthetics_api_test) | **POST** /api/v1/synthetics/tests/api | Create an API test +[**create_synthetics_browser_test**](SyntheticsApi.md#create_synthetics_browser_test) | **POST** /api/v1/synthetics/tests/browser | Create a browser test [**create_test**](SyntheticsApi.md#create_test) | **POST** /api/v1/synthetics/tests | Create a test [**delete_global_variable**](SyntheticsApi.md#delete_global_variable) | **DELETE** /api/v1/synthetics/variables/{variable_id} | Delete a global variable [**delete_private_location**](SyntheticsApi.md#delete_private_location) | **DELETE** /api/v1/synthetics/private-locations/{location_id} | Delete a private location @@ -22,6 +24,8 @@ Method | HTTP request | Description [**list_locations**](SyntheticsApi.md#list_locations) | **GET** /api/v1/synthetics/locations | Get all locations (public and private) [**list_tests**](SyntheticsApi.md#list_tests) | **GET** /api/v1/synthetics/tests | Get the list of all tests [**trigger_ci_tests**](SyntheticsApi.md#trigger_ci_tests) | **POST** /api/v1/synthetics/tests/trigger/ci | Trigger some Synthetics tests for CI +[**update_api_test**](SyntheticsApi.md#update_api_test) | **PUT** /api/v1/synthetics/tests/api/{public_id} | Edit an API test +[**update_browser_test**](SyntheticsApi.md#update_browser_test) | **PUT** /api/v1/synthetics/tests/browser/{public_id} | Edit a browser test [**update_private_location**](SyntheticsApi.md#update_private_location) | **PUT** /api/v1/synthetics/private-locations/{location_id} | Edit a private location [**update_test**](SyntheticsApi.md#update_test) | **PUT** /api/v1/synthetics/tests/{public_id} | Edit a test [**update_test_pause_status**](SyntheticsApi.md#update_test_pause_status) | **PUT** /api/v1/synthetics/tests/{public_id}/status | Pause or start a test @@ -207,12 +211,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) -# **create_test** -> SyntheticsTestDetails create_test(body) +# **create_synthetics_api_test** +> SyntheticsAPITest create_synthetics_api_test(body) -Create a test +Create an API test -Create a Synthetic test. +Create a Synthetic API test. ### Example @@ -242,8 +246,8 @@ configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY') with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = synthetics_api.SyntheticsApi(api_client) - body = SyntheticsTestDetails( - config=SyntheticsTestConfig( + body = SyntheticsAPITest( + config=SyntheticsAPITestConfig( assertions=[], config_variables=[ SyntheticsConfigVariable( @@ -282,15 +286,6 @@ with ApiClient(configuration) as api_client: timeout=3.14, url="url_example", ), - variables=[ - SyntheticsBrowserVariable( - example="example_example", - id="id_example", - name="VARIABLE_NAME", - pattern="pattern_example", - type=SyntheticsBrowserVariableType("element"), - ), - ], ), locations=[ "locations_example", @@ -318,40 +313,31 @@ with ApiClient(configuration) as api_client: ), public_id="public_id_example", status=SyntheticsTestPauseStatus("live"), - steps=[ - SyntheticsStep( - allow_failure=True, - name="name_example", - params={}, - timeout=1, - type=SyntheticsStepType("assertCurrentUrl"), - ), - ], subtype=SyntheticsTestDetailsSubType("http"), tags=[ "tags_example", ], - type=SyntheticsTestDetailsType("api"), - ) # SyntheticsTestDetails | Details of the test to create. + type=SyntheticsAPITestType("api"), + ) # SyntheticsAPITest | Details of the test to create. # example passing only required values which don't have defaults set try: - # Create a test - api_response = api_instance.create_test(body) + # Create an API test + api_response = api_instance.create_synthetics_api_test(body) pprint(api_response) except ApiException as e: - print("Exception when calling SyntheticsApi->create_test: %s\n" % e) + print("Exception when calling SyntheticsApi->create_synthetics_api_test: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**SyntheticsTestDetails**](SyntheticsTestDetails.md)| Details of the test to create. | + **body** | [**SyntheticsAPITest**](SyntheticsAPITest.md)| Details of the test to create. | ### Return type -[**SyntheticsTestDetails**](SyntheticsTestDetails.md) +[**SyntheticsAPITest**](SyntheticsAPITest.md) ### Authorization @@ -372,12 +358,12 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) -# **delete_global_variable** -> delete_global_variable(variable_id) +# **create_synthetics_browser_test** +> SyntheticsBrowserTest create_synthetics_browser_test(body) -Delete a global variable +Create a browser test -Delete a Synthetics global variable. +Create a Synthetic browser test. ### Example @@ -407,25 +393,107 @@ configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY') with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = synthetics_api.SyntheticsApi(api_client) - variable_id = "variable_id_example" # str | The ID of the global variable. + body = SyntheticsBrowserTest( + config=SyntheticsBrowserTestConfig( + assertions=[], + request=SyntheticsTestRequest( + basic_auth=SyntheticsBasicAuth( + password="", + username="", + ), + body="body_example", + certificate=SyntheticsTestRequestCertificate( + cert=SyntheticsTestRequestCertificateItem( + content="content_example", + filename="filename_example", + updated_at="updated_at_example", + ), + key=SyntheticsTestRequestCertificateItem( + content="content_example", + filename="filename_example", + updated_at="updated_at_example", + ), + ), + dns_server="dns_server_example", + headers=SyntheticsTestHeaders( + key="key_example", + ), + host="host_example", + method=HTTPMethod("GET"), + port=1, + query={}, + timeout=3.14, + url="url_example", + ), + variables=[ + SyntheticsBrowserVariable( + example="example_example", + id="id_example", + name="VARIABLE_NAME", + pattern="pattern_example", + type=SyntheticsBrowserVariableType("element"), + ), + ], + ), + locations=[ + "locations_example", + ], + message="message_example", + monitor_id=1, + name="name_example", + options=SyntheticsTestOptions( + accept_self_signed=True, + allow_insecure=True, + device_ids=[ + SyntheticsDeviceID("laptop_large"), + ], + follow_redirects=True, + min_failure_duration=1, + min_location_failed=1, + monitor_options=SyntheticsTestOptionsMonitorOptions( + renotify_interval=0, + ), + retry=SyntheticsTestOptionsRetry( + count=1, + interval=3.14, + ), + tick_every=SyntheticsTickInterval(60), + ), + public_id="public_id_example", + status=SyntheticsTestPauseStatus("live"), + steps=[ + SyntheticsStep( + allow_failure=True, + name="name_example", + params={}, + timeout=1, + type=SyntheticsStepType("assertCurrentUrl"), + ), + ], + tags=[ + "tags_example", + ], + type=SyntheticsBrowserTestType("browser"), + ) # SyntheticsBrowserTest | Details of the test to create. # example passing only required values which don't have defaults set try: - # Delete a global variable - api_instance.delete_global_variable(variable_id) + # Create a browser test + api_response = api_instance.create_synthetics_browser_test(body) + pprint(api_response) except ApiException as e: - print("Exception when calling SyntheticsApi->delete_global_variable: %s\n" % e) + print("Exception when calling SyntheticsApi->create_synthetics_browser_test: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **variable_id** | **str**| The ID of the global variable. | + **body** | [**SyntheticsBrowserTest**](SyntheticsBrowserTest.md)| Details of the test to create. | ### Return type -void (empty response body) +[**SyntheticsBrowserTest**](SyntheticsBrowserTest.md) ### Authorization @@ -433,25 +501,25 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK | - | -**400** | JSON format is wrong | - | +**200** | OK - Returns the created test details. | - | +**400** | - JSON format is wrong - Creation failed | - | +**402** | Test quota is reached | - | **403** | Forbidden | - | -**404** | Not found | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) -# **delete_private_location** -> delete_private_location(location_id) +# **create_test** +> SyntheticsTestDetails create_test(body) -Delete a private location +Create a test -Delete a Synthetics private location. +Create a Synthetic test. ### Example @@ -481,25 +549,116 @@ configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY') with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = synthetics_api.SyntheticsApi(api_client) - location_id = "location_id_example" # str | The ID of the private location. + body = SyntheticsTestDetails( + config=SyntheticsTestConfig( + assertions=[], + config_variables=[ + SyntheticsConfigVariable( + example="example_example", + name="VARIABLE_NAME", + pattern="pattern_example", + type=SyntheticsConfigVariableType("text"), + ), + ], + request=SyntheticsTestRequest( + basic_auth=SyntheticsBasicAuth( + password="", + username="", + ), + body="body_example", + certificate=SyntheticsTestRequestCertificate( + cert=SyntheticsTestRequestCertificateItem( + content="content_example", + filename="filename_example", + updated_at="updated_at_example", + ), + key=SyntheticsTestRequestCertificateItem( + content="content_example", + filename="filename_example", + updated_at="updated_at_example", + ), + ), + dns_server="dns_server_example", + headers=SyntheticsTestHeaders( + key="key_example", + ), + host="host_example", + method=HTTPMethod("GET"), + port=1, + query={}, + timeout=3.14, + url="url_example", + ), + variables=[ + SyntheticsBrowserVariable( + example="example_example", + id="id_example", + name="VARIABLE_NAME", + pattern="pattern_example", + type=SyntheticsBrowserVariableType("element"), + ), + ], + ), + locations=[ + "locations_example", + ], + message="message_example", + monitor_id=1, + name="name_example", + options=SyntheticsTestOptions( + accept_self_signed=True, + allow_insecure=True, + device_ids=[ + SyntheticsDeviceID("laptop_large"), + ], + follow_redirects=True, + min_failure_duration=1, + min_location_failed=1, + monitor_options=SyntheticsTestOptionsMonitorOptions( + renotify_interval=0, + ), + retry=SyntheticsTestOptionsRetry( + count=1, + interval=3.14, + ), + tick_every=SyntheticsTickInterval(60), + ), + public_id="public_id_example", + status=SyntheticsTestPauseStatus("live"), + steps=[ + SyntheticsStep( + allow_failure=True, + name="name_example", + params={}, + timeout=1, + type=SyntheticsStepType("assertCurrentUrl"), + ), + ], + subtype=SyntheticsTestDetailsSubType("http"), + tags=[ + "tags_example", + ], + type=SyntheticsTestDetailsType("api"), + ) # SyntheticsTestDetails | Details of the test to create. # example passing only required values which don't have defaults set try: - # Delete a private location - api_instance.delete_private_location(location_id) + # Create a test + api_response = api_instance.create_test(body) + pprint(api_response) except ApiException as e: - print("Exception when calling SyntheticsApi->delete_private_location: %s\n" % e) + print("Exception when calling SyntheticsApi->create_test: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **location_id** | **str**| The ID of the private location. | + **body** | [**SyntheticsTestDetails**](SyntheticsTestDetails.md)| Details of the test to create. | ### Return type -void (empty response body) +[**SyntheticsTestDetails**](SyntheticsTestDetails.md) ### Authorization @@ -507,23 +666,25 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | OK | - | -**404** | - Private locations are not activated for the user - Private location does not exist | - | +**200** | OK - Returns the created test details. | - | +**400** | - JSON format is wrong - Creation failed | - | +**402** | Test quota is reached | - | +**403** | Forbidden | - | [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) -# **delete_tests** -> SyntheticsDeleteTestsResponse delete_tests(body) +# **delete_global_variable** +> delete_global_variable(variable_id) -Delete tests +Delete a global variable -Delete multiple Synthetic tests by ID. +Delete a Synthetics global variable. ### Example @@ -553,7 +714,153 @@ configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY') with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = synthetics_api.SyntheticsApi(api_client) - body = SyntheticsDeleteTestsPayload( + variable_id = "variable_id_example" # str | The ID of the global variable. + + # example passing only required values which don't have defaults set + try: + # Delete a global variable + api_instance.delete_global_variable(variable_id) + except ApiException as e: + print("Exception when calling SyntheticsApi->delete_global_variable: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **variable_id** | **str**| The ID of the global variable. | + +### Return type + +void (empty response body) + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | JSON format is wrong | - | +**403** | Forbidden | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **delete_private_location** +> delete_private_location(location_id) + +Delete a private location + +Delete a Synthetics private location. + +### Example + +* Api Key Authentication (apiKeyAuth): +* Api Key Authentication (appKeyAuth): +```python +import os +from dateutil.parser import parse as dateutil_parser +from datadog_api_client.v1 import ApiClient, ApiException, Configuration +from datadog_api_client.v1.api import synthetics_api +from datadog_api_client.v1.models import * +from pprint import pprint +# See configuration.py for a list of all supported configuration parameters. +configuration = Configuration() + +# Defining the site is optional and defaults to datadoghq.com +if "DD_SITE" in os.environ: + configuration.server_variables["site"] = os.environ["DD_SITE"] + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY') + +# Configure API key authorization: appKeyAuth +configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY') + +# Enter a context with an instance of the API client +with ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = synthetics_api.SyntheticsApi(api_client) + location_id = "location_id_example" # str | The ID of the private location. + + # example passing only required values which don't have defaults set + try: + # Delete a private location + api_instance.delete_private_location(location_id) + except ApiException as e: + print("Exception when calling SyntheticsApi->delete_private_location: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **location_id** | **str**| The ID of the private location. | + +### Return type + +void (empty response body) + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | OK | - | +**404** | - Private locations are not activated for the user - Private location does not exist | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **delete_tests** +> SyntheticsDeleteTestsResponse delete_tests(body) + +Delete tests + +Delete multiple Synthetic tests by ID. + +### Example + +* Api Key Authentication (apiKeyAuth): +* Api Key Authentication (appKeyAuth): +```python +import os +from dateutil.parser import parse as dateutil_parser +from datadog_api_client.v1 import ApiClient, ApiException, Configuration +from datadog_api_client.v1.api import synthetics_api +from datadog_api_client.v1.models import * +from pprint import pprint +# See configuration.py for a list of all supported configuration parameters. +configuration = Configuration() + +# Defining the site is optional and defaults to datadoghq.com +if "DD_SITE" in os.environ: + configuration.server_variables["site"] = os.environ["DD_SITE"] + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY') + +# Configure API key authorization: appKeyAuth +configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY') + +# Enter a context with an instance of the API client +with ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = synthetics_api.SyntheticsApi(api_client) + body = SyntheticsDeleteTestsPayload( public_ids=[], ) # SyntheticsDeleteTestsPayload | Public ID list of the Synthetic tests to be deleted. @@ -1571,6 +1878,313 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) +# **update_api_test** +> SyntheticsAPITest update_api_test(public_id, body) + +Edit an API test + +Edit the configuration of a Synthetic API test. + +### Example + +* Api Key Authentication (apiKeyAuth): +* Api Key Authentication (appKeyAuth): +```python +import os +from dateutil.parser import parse as dateutil_parser +from datadog_api_client.v1 import ApiClient, ApiException, Configuration +from datadog_api_client.v1.api import synthetics_api +from datadog_api_client.v1.models import * +from pprint import pprint +# See configuration.py for a list of all supported configuration parameters. +configuration = Configuration() + +# Defining the site is optional and defaults to datadoghq.com +if "DD_SITE" in os.environ: + configuration.server_variables["site"] = os.environ["DD_SITE"] + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY') + +# Configure API key authorization: appKeyAuth +configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY') + +# Enter a context with an instance of the API client +with ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = synthetics_api.SyntheticsApi(api_client) + public_id = "public_id_example" # str | The public ID of the test to get details from. + body = SyntheticsAPITest( + config=SyntheticsAPITestConfig( + assertions=[], + config_variables=[ + SyntheticsConfigVariable( + example="example_example", + name="VARIABLE_NAME", + pattern="pattern_example", + type=SyntheticsConfigVariableType("text"), + ), + ], + request=SyntheticsTestRequest( + basic_auth=SyntheticsBasicAuth( + password="", + username="", + ), + body="body_example", + certificate=SyntheticsTestRequestCertificate( + cert=SyntheticsTestRequestCertificateItem( + content="content_example", + filename="filename_example", + updated_at="updated_at_example", + ), + key=SyntheticsTestRequestCertificateItem( + content="content_example", + filename="filename_example", + updated_at="updated_at_example", + ), + ), + dns_server="dns_server_example", + headers=SyntheticsTestHeaders( + key="key_example", + ), + host="host_example", + method=HTTPMethod("GET"), + port=1, + query={}, + timeout=3.14, + url="url_example", + ), + ), + locations=[ + "locations_example", + ], + message="message_example", + monitor_id=1, + name="name_example", + options=SyntheticsTestOptions( + accept_self_signed=True, + allow_insecure=True, + device_ids=[ + SyntheticsDeviceID("laptop_large"), + ], + follow_redirects=True, + min_failure_duration=1, + min_location_failed=1, + monitor_options=SyntheticsTestOptionsMonitorOptions( + renotify_interval=0, + ), + retry=SyntheticsTestOptionsRetry( + count=1, + interval=3.14, + ), + tick_every=SyntheticsTickInterval(60), + ), + public_id="public_id_example", + status=SyntheticsTestPauseStatus("live"), + subtype=SyntheticsTestDetailsSubType("http"), + tags=[ + "tags_example", + ], + type=SyntheticsAPITestType("api"), + ) # SyntheticsAPITest | New test details to be saved. + + # example passing only required values which don't have defaults set + try: + # Edit an API test + api_response = api_instance.update_api_test(public_id, body) + pprint(api_response) + except ApiException as e: + print("Exception when calling SyntheticsApi->update_api_test: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **public_id** | **str**| The public ID of the test to get details from. | + **body** | [**SyntheticsAPITest**](SyntheticsAPITest.md)| New test details to be saved. | + +### Return type + +[**SyntheticsAPITest**](SyntheticsAPITest.md) + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | - JSON format is wrong - Updating sub-type is forbidden | - | +**403** | Forbidden | - | +**404** | - Synthetic Monitoring is not activated for the user - Test is not owned by the user - Test can't be found | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **update_browser_test** +> SyntheticsBrowserTest update_browser_test(public_id, body) + +Edit a browser test + +Edit the configuration of a Synthetic browser test. + +### Example + +* Api Key Authentication (apiKeyAuth): +* Api Key Authentication (appKeyAuth): +```python +import os +from dateutil.parser import parse as dateutil_parser +from datadog_api_client.v1 import ApiClient, ApiException, Configuration +from datadog_api_client.v1.api import synthetics_api +from datadog_api_client.v1.models import * +from pprint import pprint +# See configuration.py for a list of all supported configuration parameters. +configuration = Configuration() + +# Defining the site is optional and defaults to datadoghq.com +if "DD_SITE" in os.environ: + configuration.server_variables["site"] = os.environ["DD_SITE"] + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.getenv('DD_CLIENT_API_KEY') + +# Configure API key authorization: appKeyAuth +configuration.api_key['appKeyAuth'] = os.getenv('DD_CLIENT_APP_KEY') + +# Enter a context with an instance of the API client +with ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = synthetics_api.SyntheticsApi(api_client) + public_id = "public_id_example" # str | The public ID of the test to get details from. + body = SyntheticsBrowserTest( + config=SyntheticsBrowserTestConfig( + assertions=[], + request=SyntheticsTestRequest( + basic_auth=SyntheticsBasicAuth( + password="", + username="", + ), + body="body_example", + certificate=SyntheticsTestRequestCertificate( + cert=SyntheticsTestRequestCertificateItem( + content="content_example", + filename="filename_example", + updated_at="updated_at_example", + ), + key=SyntheticsTestRequestCertificateItem( + content="content_example", + filename="filename_example", + updated_at="updated_at_example", + ), + ), + dns_server="dns_server_example", + headers=SyntheticsTestHeaders( + key="key_example", + ), + host="host_example", + method=HTTPMethod("GET"), + port=1, + query={}, + timeout=3.14, + url="url_example", + ), + variables=[ + SyntheticsBrowserVariable( + example="example_example", + id="id_example", + name="VARIABLE_NAME", + pattern="pattern_example", + type=SyntheticsBrowserVariableType("element"), + ), + ], + ), + locations=[ + "locations_example", + ], + message="message_example", + monitor_id=1, + name="name_example", + options=SyntheticsTestOptions( + accept_self_signed=True, + allow_insecure=True, + device_ids=[ + SyntheticsDeviceID("laptop_large"), + ], + follow_redirects=True, + min_failure_duration=1, + min_location_failed=1, + monitor_options=SyntheticsTestOptionsMonitorOptions( + renotify_interval=0, + ), + retry=SyntheticsTestOptionsRetry( + count=1, + interval=3.14, + ), + tick_every=SyntheticsTickInterval(60), + ), + public_id="public_id_example", + status=SyntheticsTestPauseStatus("live"), + steps=[ + SyntheticsStep( + allow_failure=True, + name="name_example", + params={}, + timeout=1, + type=SyntheticsStepType("assertCurrentUrl"), + ), + ], + tags=[ + "tags_example", + ], + type=SyntheticsBrowserTestType("browser"), + ) # SyntheticsBrowserTest | New test details to be saved. + + # example passing only required values which don't have defaults set + try: + # Edit a browser test + api_response = api_instance.update_browser_test(public_id, body) + pprint(api_response) + except ApiException as e: + print("Exception when calling SyntheticsApi->update_browser_test: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **public_id** | **str**| The public ID of the test to get details from. | + **body** | [**SyntheticsBrowserTest**](SyntheticsBrowserTest.md)| New test details to be saved. | + +### Return type + +[**SyntheticsBrowserTest**](SyntheticsBrowserTest.md) + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | - JSON format is wrong - Updating sub-type is forbidden | - | +**403** | Forbidden | - | +**404** | - Synthetic Monitoring is not activated for the user - Test is not owned by the user - Test can't be found | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + # **update_private_location** > SyntheticsPrivateLocation update_private_location(location_id, body) diff --git a/docs/v1/SyntheticsBrowserTest.md b/docs/v1/SyntheticsBrowserTest.md new file mode 100644 index 0000000000..0d31daa8ed --- /dev/null +++ b/docs/v1/SyntheticsBrowserTest.md @@ -0,0 +1,21 @@ +# SyntheticsBrowserTest + +Object containing details about a Synthetic browser test. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**SyntheticsBrowserTestConfig**](SyntheticsBrowserTestConfig.md) | | [optional] +**locations** | **[str]** | Array of locations used to run the test. | [optional] +**message** | **str** | Notification message associated with the test. | [optional] +**monitor_id** | **int** | The associated monitor ID. | [optional] +**name** | **str** | Name of the test. | [optional] +**options** | [**SyntheticsTestOptions**](SyntheticsTestOptions.md) | | [optional] +**public_id** | **str** | The public ID of the test. | [optional] +**status** | [**SyntheticsTestPauseStatus**](SyntheticsTestPauseStatus.md) | | [optional] +**steps** | [**[SyntheticsStep]**](SyntheticsStep.md) | The steps of the test. | [optional] +**tags** | **[str]** | Array of tags attached to the test. | [optional] +**type** | [**SyntheticsBrowserTestType**](SyntheticsBrowserTestType.md) | | [optional] + +[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) + + diff --git a/docs/v1/SyntheticsBrowserTestConfig.md b/docs/v1/SyntheticsBrowserTestConfig.md new file mode 100644 index 0000000000..2fa8681fbb --- /dev/null +++ b/docs/v1/SyntheticsBrowserTestConfig.md @@ -0,0 +1,13 @@ +# SyntheticsBrowserTestConfig + +Configuration object for a Synthetic browser test. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**request** | [**SyntheticsTestRequest**](SyntheticsTestRequest.md) | | +**assertions** | [**[SyntheticsAssertion]**](SyntheticsAssertion.md) | Array of assertions used for the test. | defaults to [] +**variables** | [**[SyntheticsBrowserVariable]**](SyntheticsBrowserVariable.md) | Array of variables used for the test steps. | [optional] + +[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) + + diff --git a/docs/v1/SyntheticsBrowserTestType.md b/docs/v1/SyntheticsBrowserTestType.md new file mode 100644 index 0000000000..fb70b8d889 --- /dev/null +++ b/docs/v1/SyntheticsBrowserTestType.md @@ -0,0 +1,11 @@ +# SyntheticsBrowserTestType + +Type of the Synthetic test, `browser`. +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | Type of the Synthetic test, `browser`. | defaults to "browser", must be one of ["browser", ] + +[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) + + diff --git a/src/datadog_api_client/v1/api/synthetics_api.py b/src/datadog_api_client/v1/api/synthetics_api.py index 962ef0e088..ba7a0a744b 100644 --- a/src/datadog_api_client/v1/api/synthetics_api.py +++ b/src/datadog_api_client/v1/api/synthetics_api.py @@ -17,7 +17,9 @@ validate_and_convert_types, ) from datadog_api_client.v1.model.api_error_response import APIErrorResponse +from datadog_api_client.v1.model.synthetics_api_test import SyntheticsAPITest from datadog_api_client.v1.model.synthetics_api_test_result_full import SyntheticsAPITestResultFull +from datadog_api_client.v1.model.synthetics_browser_test import SyntheticsBrowserTest from datadog_api_client.v1.model.synthetics_browser_test_result_full import SyntheticsBrowserTestResultFull from datadog_api_client.v1.model.synthetics_ci_test_body import SyntheticsCITestBody from datadog_api_client.v1.model.synthetics_delete_tests_payload import SyntheticsDeleteTestsPayload @@ -226,6 +228,178 @@ def __create_private_location(self, body, **kwargs): callable=__create_private_location, ) + def __create_synthetics_api_test(self, body, **kwargs): + """Create an API test # noqa: E501 + + Create a Synthetic API test. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_synthetics_api_test(body, async_req=True) + >>> result = thread.get() + + Args: + body (SyntheticsAPITest): Details of the test to create. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + SyntheticsAPITest + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["body"] = body + return self.call_with_http_info(**kwargs) + + self.create_synthetics_api_test = _Endpoint( + settings={ + "response_type": (SyntheticsAPITest,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v1/synthetics/tests/api", + "operation_id": "create_synthetics_api_test", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": [ + "body", + ], + "required": [ + "body", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "body": (SyntheticsAPITest,), + }, + "attribute_map": {}, + "location_map": { + "body": "body", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__create_synthetics_api_test, + ) + + def __create_synthetics_browser_test(self, body, **kwargs): + """Create a browser test # noqa: E501 + + Create a Synthetic browser test. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_synthetics_browser_test(body, async_req=True) + >>> result = thread.get() + + Args: + body (SyntheticsBrowserTest): Details of the test to create. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + SyntheticsBrowserTest + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["body"] = body + return self.call_with_http_info(**kwargs) + + self.create_synthetics_browser_test = _Endpoint( + settings={ + "response_type": (SyntheticsBrowserTest,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v1/synthetics/tests/browser", + "operation_id": "create_synthetics_browser_test", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": [ + "body", + ], + "required": [ + "body", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "body": (SyntheticsBrowserTest,), + }, + "attribute_map": {}, + "location_map": { + "body": "body", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__create_synthetics_browser_test, + ) + def __create_test(self, body, **kwargs): """Create a test # noqa: E501 @@ -1680,6 +1854,194 @@ def __trigger_ci_tests(self, body, **kwargs): callable=__trigger_ci_tests, ) + def __update_api_test(self, public_id, body, **kwargs): + """Edit an API test # noqa: E501 + + Edit the configuration of a Synthetic API test. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_api_test(public_id, body, async_req=True) + >>> result = thread.get() + + Args: + public_id (str): The public ID of the test to get details from. + body (SyntheticsAPITest): New test details to be saved. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + SyntheticsAPITest + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["public_id"] = public_id + kwargs["body"] = body + return self.call_with_http_info(**kwargs) + + self.update_api_test = _Endpoint( + settings={ + "response_type": (SyntheticsAPITest,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v1/synthetics/tests/api/{public_id}", + "operation_id": "update_api_test", + "http_method": "PUT", + "servers": None, + }, + params_map={ + "all": [ + "public_id", + "body", + ], + "required": [ + "public_id", + "body", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "public_id": (str,), + "body": (SyntheticsAPITest,), + }, + "attribute_map": { + "public_id": "public_id", + }, + "location_map": { + "public_id": "path", + "body": "body", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__update_api_test, + ) + + def __update_browser_test(self, public_id, body, **kwargs): + """Edit a browser test # noqa: E501 + + Edit the configuration of a Synthetic browser test. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_browser_test(public_id, body, async_req=True) + >>> result = thread.get() + + Args: + public_id (str): The public ID of the test to get details from. + body (SyntheticsBrowserTest): New test details to be saved. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (float/tuple): timeout setting for this request. If one + number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + SyntheticsBrowserTest + If the method is called asynchronously, returns the request + thread. + """ + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["public_id"] = public_id + kwargs["body"] = body + return self.call_with_http_info(**kwargs) + + self.update_browser_test = _Endpoint( + settings={ + "response_type": (SyntheticsBrowserTest,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v1/synthetics/tests/browser/{public_id}", + "operation_id": "update_browser_test", + "http_method": "PUT", + "servers": None, + }, + params_map={ + "all": [ + "public_id", + "body", + ], + "required": [ + "public_id", + "body", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "public_id": (str,), + "body": (SyntheticsBrowserTest,), + }, + "attribute_map": { + "public_id": "public_id", + }, + "location_map": { + "public_id": "path", + "body": "body", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__update_browser_test, + ) + def __update_private_location(self, location_id, body, **kwargs): """Edit a private location # noqa: E501 diff --git a/src/datadog_api_client/v1/model/synthetics_api_test.py b/src/datadog_api_client/v1/model/synthetics_api_test.py new file mode 100644 index 0000000000..69d2700dbb --- /dev/null +++ b/src/datadog_api_client/v1/model/synthetics_api_test.py @@ -0,0 +1,210 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import re # noqa: F401 +import sys # noqa: F401 + +import nulltype # noqa: F401 + +from datadog_api_client.v1.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +def lazy_import(): + from datadog_api_client.v1.model.synthetics_api_test_config import SyntheticsAPITestConfig + from datadog_api_client.v1.model.synthetics_api_test_type import SyntheticsAPITestType + from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType + from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions + from datadog_api_client.v1.model.synthetics_test_pause_status import SyntheticsTestPauseStatus + + globals()["SyntheticsAPITestConfig"] = SyntheticsAPITestConfig + globals()["SyntheticsAPITestType"] = SyntheticsAPITestType + globals()["SyntheticsTestDetailsSubType"] = SyntheticsTestDetailsSubType + globals()["SyntheticsTestOptions"] = SyntheticsTestOptions + globals()["SyntheticsTestPauseStatus"] = SyntheticsTestPauseStatus + + +class SyntheticsAPITest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "config": (SyntheticsAPITestConfig,), # noqa: E501 + "locations": ([str],), # noqa: E501 + "message": (str,), # noqa: E501 + "monitor_id": (int,), # noqa: E501 + "name": (str,), # noqa: E501 + "options": (SyntheticsTestOptions,), # noqa: E501 + "public_id": (str,), # noqa: E501 + "status": (SyntheticsTestPauseStatus,), # noqa: E501 + "subtype": (SyntheticsTestDetailsSubType,), # noqa: E501 + "tags": ([str],), # noqa: E501 + "type": (SyntheticsAPITestType,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "config": "config", # noqa: E501 + "locations": "locations", # noqa: E501 + "message": "message", # noqa: E501 + "monitor_id": "monitor_id", # noqa: E501 + "name": "name", # noqa: E501 + "options": "options", # noqa: E501 + "public_id": "public_id", # noqa: E501 + "status": "status", # noqa: E501 + "subtype": "subtype", # noqa: E501 + "tags": "tags", # noqa: E501 + "type": "type", # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SyntheticsAPITest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + config (SyntheticsAPITestConfig): [optional] # noqa: E501 + locations ([str]): Array of locations used to run the test.. [optional] # noqa: E501 + message (str): Notification message associated with the test.. [optional] # noqa: E501 + monitor_id (int): The associated monitor ID.. [optional] # noqa: E501 + name (str): Name of the test.. [optional] # noqa: E501 + options (SyntheticsTestOptions): [optional] # noqa: E501 + public_id (str): The public ID for the test.. [optional] # noqa: E501 + status (SyntheticsTestPauseStatus): [optional] # noqa: E501 + subtype (SyntheticsTestDetailsSubType): [optional] # noqa: E501 + tags ([str]): Array of tags attached to the test.. [optional] # noqa: E501 + type (SyntheticsAPITestType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/src/datadog_api_client/v1/model/synthetics_api_test_config.py b/src/datadog_api_client/v1/model/synthetics_api_test_config.py new file mode 100644 index 0000000000..5f0bdfe5c9 --- /dev/null +++ b/src/datadog_api_client/v1/model/synthetics_api_test_config.py @@ -0,0 +1,187 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import re # noqa: F401 +import sys # noqa: F401 + +import nulltype # noqa: F401 + +from datadog_api_client.v1.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +def lazy_import(): + from datadog_api_client.v1.model.synthetics_assertion import SyntheticsAssertion + from datadog_api_client.v1.model.synthetics_config_variable import SyntheticsConfigVariable + from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest + + globals()["SyntheticsAssertion"] = SyntheticsAssertion + globals()["SyntheticsConfigVariable"] = SyntheticsConfigVariable + globals()["SyntheticsTestRequest"] = SyntheticsTestRequest + + +class SyntheticsAPITestConfig(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "assertions": ([SyntheticsAssertion],), # noqa: E501 + "request": (SyntheticsTestRequest,), # noqa: E501 + "config_variables": ([SyntheticsConfigVariable],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "assertions": "assertions", # noqa: E501 + "request": "request", # noqa: E501 + "config_variables": "configVariables", # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, request, *args, **kwargs): # noqa: E501 + """SyntheticsAPITestConfig - a model defined in OpenAPI + + Args: + request (SyntheticsTestRequest): + + Keyword Args: + assertions ([SyntheticsAssertion]): Array of assertions used for the test.. defaults to [] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + config_variables ([SyntheticsConfigVariable]): Array of variables used for the test.. [optional] # noqa: E501 + """ + + assertions = kwargs.get("assertions", []) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.assertions = assertions + self.request = request + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/src/datadog_api_client/v1/model/synthetics_api_test_type.py b/src/datadog_api_client/v1/model/synthetics_api_test_type.py new file mode 100644 index 0000000000..0a4ee29197 --- /dev/null +++ b/src/datadog_api_client/v1/model/synthetics_api_test_type.py @@ -0,0 +1,176 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import re # noqa: F401 +import sys # noqa: F401 + +import nulltype # noqa: F401 + +from datadog_api_client.v1.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class SyntheticsAPITestType(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ("value",): { + "API": "api", + }, + } + + validations = {} + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "value": (str,), + } + + @cached_property + def discriminator(): + return None + + attribute_map = {} + + _composed_schemas = None + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """SyntheticsAPITestType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the Synthetic test, `api`.. if omitted defaults to "api", must be one of ["api", ] # noqa: E501 + + Keyword Args: + value (str): Type of the Synthetic test, `api`.. if omitted defaults to "api", must be one of ["api", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "api" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/src/datadog_api_client/v1/model/synthetics_browser_test.py b/src/datadog_api_client/v1/model/synthetics_browser_test.py new file mode 100644 index 0000000000..3ecd3c884d --- /dev/null +++ b/src/datadog_api_client/v1/model/synthetics_browser_test.py @@ -0,0 +1,210 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import re # noqa: F401 +import sys # noqa: F401 + +import nulltype # noqa: F401 + +from datadog_api_client.v1.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +def lazy_import(): + from datadog_api_client.v1.model.synthetics_browser_test_config import SyntheticsBrowserTestConfig + from datadog_api_client.v1.model.synthetics_browser_test_type import SyntheticsBrowserTestType + from datadog_api_client.v1.model.synthetics_step import SyntheticsStep + from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions + from datadog_api_client.v1.model.synthetics_test_pause_status import SyntheticsTestPauseStatus + + globals()["SyntheticsBrowserTestConfig"] = SyntheticsBrowserTestConfig + globals()["SyntheticsBrowserTestType"] = SyntheticsBrowserTestType + globals()["SyntheticsStep"] = SyntheticsStep + globals()["SyntheticsTestOptions"] = SyntheticsTestOptions + globals()["SyntheticsTestPauseStatus"] = SyntheticsTestPauseStatus + + +class SyntheticsBrowserTest(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "config": (SyntheticsBrowserTestConfig,), # noqa: E501 + "locations": ([str],), # noqa: E501 + "message": (str,), # noqa: E501 + "monitor_id": (int,), # noqa: E501 + "name": (str,), # noqa: E501 + "options": (SyntheticsTestOptions,), # noqa: E501 + "public_id": (str,), # noqa: E501 + "status": (SyntheticsTestPauseStatus,), # noqa: E501 + "steps": ([SyntheticsStep],), # noqa: E501 + "tags": ([str],), # noqa: E501 + "type": (SyntheticsBrowserTestType,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "config": "config", # noqa: E501 + "locations": "locations", # noqa: E501 + "message": "message", # noqa: E501 + "monitor_id": "monitor_id", # noqa: E501 + "name": "name", # noqa: E501 + "options": "options", # noqa: E501 + "public_id": "public_id", # noqa: E501 + "status": "status", # noqa: E501 + "steps": "steps", # noqa: E501 + "tags": "tags", # noqa: E501 + "type": "type", # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """SyntheticsBrowserTest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + config (SyntheticsBrowserTestConfig): [optional] # noqa: E501 + locations ([str]): Array of locations used to run the test.. [optional] # noqa: E501 + message (str): Notification message associated with the test.. [optional] # noqa: E501 + monitor_id (int): The associated monitor ID.. [optional] # noqa: E501 + name (str): Name of the test.. [optional] # noqa: E501 + options (SyntheticsTestOptions): [optional] # noqa: E501 + public_id (str): The public ID of the test.. [optional] # noqa: E501 + status (SyntheticsTestPauseStatus): [optional] # noqa: E501 + steps ([SyntheticsStep]): The steps of the test.. [optional] # noqa: E501 + tags ([str]): Array of tags attached to the test.. [optional] # noqa: E501 + type (SyntheticsBrowserTestType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/src/datadog_api_client/v1/model/synthetics_browser_test_config.py b/src/datadog_api_client/v1/model/synthetics_browser_test_config.py new file mode 100644 index 0000000000..140612c0c0 --- /dev/null +++ b/src/datadog_api_client/v1/model/synthetics_browser_test_config.py @@ -0,0 +1,187 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import re # noqa: F401 +import sys # noqa: F401 + +import nulltype # noqa: F401 + +from datadog_api_client.v1.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +def lazy_import(): + from datadog_api_client.v1.model.synthetics_assertion import SyntheticsAssertion + from datadog_api_client.v1.model.synthetics_browser_variable import SyntheticsBrowserVariable + from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest + + globals()["SyntheticsAssertion"] = SyntheticsAssertion + globals()["SyntheticsBrowserVariable"] = SyntheticsBrowserVariable + globals()["SyntheticsTestRequest"] = SyntheticsTestRequest + + +class SyntheticsBrowserTestConfig(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = {} + + validations = {} + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "assertions": ([SyntheticsAssertion],), # noqa: E501 + "request": (SyntheticsTestRequest,), # noqa: E501 + "variables": ([SyntheticsBrowserVariable],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + attribute_map = { + "assertions": "assertions", # noqa: E501 + "request": "request", # noqa: E501 + "variables": "variables", # noqa: E501 + } + + _composed_schemas = {} + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, request, *args, **kwargs): # noqa: E501 + """SyntheticsBrowserTestConfig - a model defined in OpenAPI + + Args: + request (SyntheticsTestRequest): + + Keyword Args: + assertions ([SyntheticsAssertion]): Array of assertions used for the test.. defaults to [] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + variables ([SyntheticsBrowserVariable]): Array of variables used for the test steps.. [optional] # noqa: E501 + """ + + assertions = kwargs.get("assertions", []) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.assertions = assertions + self.request = request + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) diff --git a/src/datadog_api_client/v1/model/synthetics_browser_test_type.py b/src/datadog_api_client/v1/model/synthetics_browser_test_type.py new file mode 100644 index 0000000000..ade61de6d4 --- /dev/null +++ b/src/datadog_api_client/v1/model/synthetics_browser_test_type.py @@ -0,0 +1,176 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import re # noqa: F401 +import sys # noqa: F401 + +import nulltype # noqa: F401 + +from datadog_api_client.v1.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) + + +class SyntheticsBrowserTestType(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ("value",): { + "BROWSER": "browser", + }, + } + + validations = {} + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "value": (str,), + } + + @cached_property + def discriminator(): + return None + + attribute_map = {} + + _composed_schemas = None + + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """SyntheticsBrowserTestType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the Synthetic test, `browser`.. if omitted defaults to "browser", must be one of ["browser", ] # noqa: E501 + + Keyword Args: + value (str): Type of the Synthetic test, `browser`.. if omitted defaults to "browser", must be one of ["browser", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "browser" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index 5211ecf2e5..ee9a8a3a24 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -305,11 +305,14 @@ from datadog_api_client.v1.model.slack_integration_channel import SlackIntegrationChannel from datadog_api_client.v1.model.slack_integration_channel_display import SlackIntegrationChannelDisplay from datadog_api_client.v1.model.slack_integration_channels import SlackIntegrationChannels +from datadog_api_client.v1.model.synthetics_api_test import SyntheticsAPITest +from datadog_api_client.v1.model.synthetics_api_test_config import SyntheticsAPITestConfig from datadog_api_client.v1.model.synthetics_api_test_result_data import SyntheticsAPITestResultData from datadog_api_client.v1.model.synthetics_api_test_result_full import SyntheticsAPITestResultFull from datadog_api_client.v1.model.synthetics_api_test_result_full_check import SyntheticsAPITestResultFullCheck from datadog_api_client.v1.model.synthetics_api_test_result_short import SyntheticsAPITestResultShort from datadog_api_client.v1.model.synthetics_api_test_result_short_result import SyntheticsAPITestResultShortResult +from datadog_api_client.v1.model.synthetics_api_test_type import SyntheticsAPITestType from datadog_api_client.v1.model.synthetics_assertion import SyntheticsAssertion from datadog_api_client.v1.model.synthetics_assertion_json_path_operator import SyntheticsAssertionJSONPathOperator from datadog_api_client.v1.model.synthetics_assertion_json_path_target import SyntheticsAssertionJSONPathTarget @@ -322,6 +325,8 @@ from datadog_api_client.v1.model.synthetics_basic_auth import SyntheticsBasicAuth from datadog_api_client.v1.model.synthetics_browser_error import SyntheticsBrowserError from datadog_api_client.v1.model.synthetics_browser_error_type import SyntheticsBrowserErrorType +from datadog_api_client.v1.model.synthetics_browser_test import SyntheticsBrowserTest +from datadog_api_client.v1.model.synthetics_browser_test_config import SyntheticsBrowserTestConfig from datadog_api_client.v1.model.synthetics_browser_test_result_data import SyntheticsBrowserTestResultData from datadog_api_client.v1.model.synthetics_browser_test_result_full import SyntheticsBrowserTestResultFull from datadog_api_client.v1.model.synthetics_browser_test_result_full_check import SyntheticsBrowserTestResultFullCheck @@ -329,6 +334,7 @@ from datadog_api_client.v1.model.synthetics_browser_test_result_short_result import ( SyntheticsBrowserTestResultShortResult, ) +from datadog_api_client.v1.model.synthetics_browser_test_type import SyntheticsBrowserTestType from datadog_api_client.v1.model.synthetics_browser_variable import SyntheticsBrowserVariable from datadog_api_client.v1.model.synthetics_browser_variable_type import SyntheticsBrowserVariableType from datadog_api_client.v1.model.synthetics_ci_test import SyntheticsCITest diff --git a/src/datadog_api_client/v1/openapi.yaml b/src/datadog_api_client/v1/openapi.yaml index 2938f9d8b4..2cd74effd6 100644 --- a/src/datadog_api_client/v1/openapi.yaml +++ b/src/datadog_api_client/v1/openapi.yaml @@ -6291,6 +6291,66 @@ components: items: $ref: '#/components/schemas/SlackIntegrationChannel' type: array + SyntheticsAPITest: + description: Object containing details about a Synthetic API test. + properties: + config: + $ref: '#/components/schemas/SyntheticsAPITestConfig' + locations: + description: Array of locations used to run the test. + items: + description: A location from which the test was run. + type: string + type: array + message: + description: Notification message associated with the test. + type: string + monitor_id: + description: The associated monitor ID. + format: int64 + type: integer + name: + description: Name of the test. + type: string + options: + $ref: '#/components/schemas/SyntheticsTestOptions' + public_id: + description: The public ID for the test. + type: string + status: + $ref: '#/components/schemas/SyntheticsTestPauseStatus' + subtype: + $ref: '#/components/schemas/SyntheticsTestDetailsSubType' + tags: + description: Array of tags attached to the test. + items: + description: A tag attached to the test. + type: string + type: array + type: + $ref: '#/components/schemas/SyntheticsAPITestType' + type: object + SyntheticsAPITestConfig: + description: Configuration object for a Synthetic API test. + properties: + assertions: + default: [] + description: Array of assertions used for the test. + example: [] + items: + $ref: '#/components/schemas/SyntheticsAssertion' + type: array + configVariables: + description: Array of variables used for the test. + items: + $ref: '#/components/schemas/SyntheticsConfigVariable' + type: array + request: + $ref: '#/components/schemas/SyntheticsTestRequest' + required: + - request + - assertions + type: object SyntheticsAPITestResultData: description: Object containing results for your Synthetic API test. properties: @@ -6381,6 +6441,15 @@ components: status: $ref: '#/components/schemas/SyntheticsTestMonitorStatus' type: object + SyntheticsAPITestType: + default: api + description: Type of the Synthetic test, `api`. + enum: + - api + example: api + type: string + x-enum-varnames: + - API SyntheticsAssertion: description: 'Object describing the assertions type, their associated operator, @@ -6543,6 +6612,69 @@ components: x-enum-varnames: - NETWORK - JS + SyntheticsBrowserTest: + description: Object containing details about a Synthetic browser test. + properties: + config: + $ref: '#/components/schemas/SyntheticsBrowserTestConfig' + locations: + description: Array of locations used to run the test. + items: + description: A location from which the test was run. + type: string + type: array + message: + description: Notification message associated with the test. + type: string + monitor_id: + description: The associated monitor ID. + format: int64 + type: integer + name: + description: Name of the test. + type: string + options: + $ref: '#/components/schemas/SyntheticsTestOptions' + public_id: + description: The public ID of the test. + type: string + status: + $ref: '#/components/schemas/SyntheticsTestPauseStatus' + steps: + description: The steps of the test. + items: + $ref: '#/components/schemas/SyntheticsStep' + type: array + tags: + description: Array of tags attached to the test. + items: + description: A tag attached to the test. + type: string + type: array + type: + $ref: '#/components/schemas/SyntheticsBrowserTestType' + type: object + SyntheticsBrowserTestConfig: + description: Configuration object for a Synthetic browser test. + properties: + assertions: + default: [] + description: Array of assertions used for the test. + example: [] + items: + $ref: '#/components/schemas/SyntheticsAssertion' + type: array + request: + $ref: '#/components/schemas/SyntheticsTestRequest' + variables: + description: Array of variables used for the test steps. + items: + $ref: '#/components/schemas/SyntheticsBrowserVariable' + type: array + required: + - request + - assertions + type: object SyntheticsBrowserTestResultData: description: Object containing results for your Synthetic browser test. properties: @@ -6657,6 +6789,15 @@ components: - from_ts - to_ts type: object + SyntheticsBrowserTestType: + default: browser + description: Type of the Synthetic test, `browser`. + enum: + - browser + example: browser + type: string + x-enum-varnames: + - BROWSER SyntheticsBrowserVariable: description: 'Object defining a variable that can be used in your browser test. @@ -16004,6 +16145,7 @@ paths: x-undo: type: safe post: + deprecated: true description: Create a Synthetic test. operationId: CreateTest requestBody: @@ -16048,6 +16190,145 @@ paths: operationId: TODO parameters: [] type: unsafe + /api/v1/synthetics/tests/api: + post: + description: Create a Synthetic API test. + operationId: CreateSyntheticsAPITest + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsAPITest' + description: Details of the test to create. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsAPITest' + description: OK - Returns the created test details. + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: '- JSON format is wrong + + - Creation failed' + '402': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Test quota is reached + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + summary: Create an API test + tags: + - Synthetics + x-codegen-request-body-name: body + /api/v1/synthetics/tests/api/{public_id}: + put: + description: Edit the configuration of a Synthetic API test. + operationId: UpdateAPITest + parameters: + - description: The public ID of the test to get details from. + in: path + name: public_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsAPITest' + description: New test details to be saved. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsAPITest' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: '- JSON format is wrong + + - Updating sub-type is forbidden' + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: '- Synthetic Monitoring is not activated for the user + + - Test is not owned by the user + + - Test can''t be found' + summary: Edit an API test + tags: + - Synthetics + x-codegen-request-body-name: body + x-undo: + type: idempotent + /api/v1/synthetics/tests/browser: + post: + description: Create a Synthetic browser test. + operationId: CreateSyntheticsBrowserTest + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsBrowserTest' + description: Details of the test to create. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsBrowserTest' + description: OK - Returns the created test details. + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: '- JSON format is wrong + + - Creation failed' + '402': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Test quota is reached + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + summary: Create a browser test + tags: + - Synthetics + x-codegen-request-body-name: body /api/v1/synthetics/tests/browser/{public_id}: get: description: 'Get the detailed configuration (including steps) associated with @@ -16087,6 +16368,60 @@ paths: - Synthetics x-undo: type: safe + put: + description: Edit the configuration of a Synthetic browser test. + operationId: UpdateBrowserTest + parameters: + - description: The public ID of the test to get details from. + in: path + name: public_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsBrowserTest' + description: New test details to be saved. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsBrowserTest' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: '- JSON format is wrong + + - Updating sub-type is forbidden' + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: '- Synthetic Monitoring is not activated for the user + + - Test is not owned by the user + + - Test can''t be found' + summary: Edit a browser test + tags: + - Synthetics + x-codegen-request-body-name: body + x-undo: + type: idempotent /api/v1/synthetics/tests/browser/{public_id}/results: get: description: Get the last 50 test results summaries for a given Synthetics Browser @@ -16312,6 +16647,7 @@ paths: x-undo: type: safe put: + deprecated: true description: Edit the configuration of a Synthetic test. operationId: UpdateTest parameters: diff --git a/tests/v1/features/synthetics.feature b/tests/v1/features/synthetics.feature index e4a1ccef2a..d0c065c4b7 100644 --- a/tests/v1/features/synthetics.feature +++ b/tests/v1/features/synthetics.feature @@ -15,6 +15,27 @@ Feature: Synthetics And a valid "appKeyAuth" key in the system And an instance of "Synthetics" API + @generated @skip + Scenario: Create a browser test returns "- JSON format is wrong" response + Given new "CreateSyntheticsBrowserTest" request + And body {} + When the request is sent + Then the response status is 400 - JSON format is wrong + + @generated @skip + Scenario: Create a browser test returns "OK - Returns the created test details." response + Given new "CreateSyntheticsBrowserTest" request + And body {} + When the request is sent + Then the response status is 200 OK - Returns the created test details. + + @generated @skip + Scenario: Create a browser test returns "Test quota is reached" response + Given new "CreateSyntheticsBrowserTest" request + And body {} + When the request is sent + Then the response status is 402 Test quota is reached + @generated @skip Scenario: Create a global variable returns "Invalid request" response Given new "CreateGlobalVariable" request @@ -71,6 +92,27 @@ Feature: Synthetics When the request is sent Then the response status is 402 Test quota is reached + @generated @skip + Scenario: Create an API test returns "- JSON format is wrong" response + Given new "CreateSyntheticsAPITest" request + And body {} + When the request is sent + Then the response status is 400 - JSON format is wrong + + @generated @skip + Scenario: Create an API test returns "OK - Returns the created test details." response + Given new "CreateSyntheticsAPITest" request + And body {} + When the request is sent + Then the response status is 200 OK - Returns the created test details. + + @generated @skip + Scenario: Create an API test returns "Test quota is reached" response + Given new "CreateSyntheticsAPITest" request + And body {} + When the request is sent + Then the response status is 402 Test quota is reached + @generated @skip Scenario: Delete a global variable returns "JSON format is wrong" response Given new "DeleteGlobalVariable" request @@ -127,6 +169,30 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK. + @generated @skip + Scenario: Edit a browser test returns "- JSON format is wrong" response + Given new "UpdateBrowserTest" request + And request contains "public_id" parameter from "" + And body {} + When the request is sent + Then the response status is 400 - JSON format is wrong + + @generated @skip + Scenario: Edit a browser test returns "- Synthetic Monitoring is not activated for the user" response + Given new "UpdateBrowserTest" request + And request contains "public_id" parameter from "" + And body {} + When the request is sent + Then the response status is 404 - Synthetic Monitoring is not activated for the user + + @generated @skip + Scenario: Edit a browser test returns "OK" response + Given new "UpdateBrowserTest" request + And request contains "public_id" parameter from "" + And body {} + When the request is sent + Then the response status is 200 OK + @generated @skip Scenario: Edit a global variable returns "Invalid request" response Given new "EditGlobalVariable" request @@ -183,6 +249,30 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip + Scenario: Edit an API test returns "- JSON format is wrong" response + Given new "UpdateAPITest" request + And request contains "public_id" parameter from "" + And body {} + When the request is sent + Then the response status is 400 - JSON format is wrong + + @generated @skip + Scenario: Edit an API test returns "- Synthetic Monitoring is not activated for the user" response + Given new "UpdateAPITest" request + And request contains "public_id" parameter from "" + And body {} + When the request is sent + Then the response status is 404 - Synthetic Monitoring is not activated for the user + + @generated @skip + Scenario: Edit an API test returns "OK" response + Given new "UpdateAPITest" request + And request contains "public_id" parameter from "" + And body {} + When the request is sent + Then the response status is 200 OK + @generated @skip Scenario: Get a global variable returns "Not found" response Given new "GetGlobalVariable" request diff --git a/tests/v1/features/undo.json b/tests/v1/features/undo.json index 95d2232f2f..3999bc525e 100644 --- a/tests/v1/features/undo.json +++ b/tests/v1/features/undo.json @@ -826,12 +826,30 @@ "type": "unsafe" } }, + "CreateSyntheticsAPITest": { + "tag": "Synthetics" + }, + "UpdateAPITest": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, + "CreateSyntheticsBrowserTest": { + "tag": "Synthetics" + }, "GetBrowserTest": { "tag": "Synthetics", "undo": { "type": "safe" } }, + "UpdateBrowserTest": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, "GetBrowserTestLatestResults": { "tag": "Synthetics", "undo": { diff --git a/tests/v1/test_synthetics_api_test.py b/tests/v1/test_synthetics_api_test.py new file mode 100644 index 0000000000..0e6d41ea49 --- /dev/null +++ b/tests/v1/test_synthetics_api_test.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import sys +import unittest + +import datadog_api_client.v1 +from datadog_api_client.v1.model.synthetics_api_test_config import SyntheticsAPITestConfig +from datadog_api_client.v1.model.synthetics_api_test_type import SyntheticsAPITestType +from datadog_api_client.v1.model.synthetics_test_details_sub_type import SyntheticsTestDetailsSubType +from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions +from datadog_api_client.v1.model.synthetics_test_pause_status import SyntheticsTestPauseStatus + +globals()["SyntheticsAPITestConfig"] = SyntheticsAPITestConfig +globals()["SyntheticsAPITestType"] = SyntheticsAPITestType +globals()["SyntheticsTestDetailsSubType"] = SyntheticsTestDetailsSubType +globals()["SyntheticsTestOptions"] = SyntheticsTestOptions +globals()["SyntheticsTestPauseStatus"] = SyntheticsTestPauseStatus +from datadog_api_client.v1.model.synthetics_api_test import SyntheticsAPITest + + +class TestSyntheticsAPITest(unittest.TestCase): + """SyntheticsAPITest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSyntheticsAPITest(self): + """Test SyntheticsAPITest""" + # FIXME: construct object with mandatory attributes with example values + # model = SyntheticsAPITest() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/v1/test_synthetics_api_test_config.py b/tests/v1/test_synthetics_api_test_config.py new file mode 100644 index 0000000000..cae920934b --- /dev/null +++ b/tests/v1/test_synthetics_api_test_config.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import sys +import unittest + +import datadog_api_client.v1 +from datadog_api_client.v1.model.synthetics_assertion import SyntheticsAssertion +from datadog_api_client.v1.model.synthetics_config_variable import SyntheticsConfigVariable +from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest + +globals()["SyntheticsAssertion"] = SyntheticsAssertion +globals()["SyntheticsConfigVariable"] = SyntheticsConfigVariable +globals()["SyntheticsTestRequest"] = SyntheticsTestRequest +from datadog_api_client.v1.model.synthetics_api_test_config import SyntheticsAPITestConfig + + +class TestSyntheticsAPITestConfig(unittest.TestCase): + """SyntheticsAPITestConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSyntheticsAPITestConfig(self): + """Test SyntheticsAPITestConfig""" + # FIXME: construct object with mandatory attributes with example values + # model = SyntheticsAPITestConfig() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/v1/test_synthetics_api_test_type.py b/tests/v1/test_synthetics_api_test_type.py new file mode 100644 index 0000000000..94e4626e52 --- /dev/null +++ b/tests/v1/test_synthetics_api_test_type.py @@ -0,0 +1,30 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import sys +import unittest + +import datadog_api_client.v1 +from datadog_api_client.v1.model.synthetics_api_test_type import SyntheticsAPITestType + + +class TestSyntheticsAPITestType(unittest.TestCase): + """SyntheticsAPITestType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSyntheticsAPITestType(self): + """Test SyntheticsAPITestType""" + # FIXME: construct object with mandatory attributes with example values + # model = SyntheticsAPITestType() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/v1/test_synthetics_browser_test.py b/tests/v1/test_synthetics_browser_test.py new file mode 100644 index 0000000000..f96db64e03 --- /dev/null +++ b/tests/v1/test_synthetics_browser_test.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import sys +import unittest + +import datadog_api_client.v1 +from datadog_api_client.v1.model.synthetics_browser_test_config import SyntheticsBrowserTestConfig +from datadog_api_client.v1.model.synthetics_browser_test_type import SyntheticsBrowserTestType +from datadog_api_client.v1.model.synthetics_step import SyntheticsStep +from datadog_api_client.v1.model.synthetics_test_options import SyntheticsTestOptions +from datadog_api_client.v1.model.synthetics_test_pause_status import SyntheticsTestPauseStatus + +globals()["SyntheticsBrowserTestConfig"] = SyntheticsBrowserTestConfig +globals()["SyntheticsBrowserTestType"] = SyntheticsBrowserTestType +globals()["SyntheticsStep"] = SyntheticsStep +globals()["SyntheticsTestOptions"] = SyntheticsTestOptions +globals()["SyntheticsTestPauseStatus"] = SyntheticsTestPauseStatus +from datadog_api_client.v1.model.synthetics_browser_test import SyntheticsBrowserTest + + +class TestSyntheticsBrowserTest(unittest.TestCase): + """SyntheticsBrowserTest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSyntheticsBrowserTest(self): + """Test SyntheticsBrowserTest""" + # FIXME: construct object with mandatory attributes with example values + # model = SyntheticsBrowserTest() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/v1/test_synthetics_browser_test_config.py b/tests/v1/test_synthetics_browser_test_config.py new file mode 100644 index 0000000000..d3dbf4af9e --- /dev/null +++ b/tests/v1/test_synthetics_browser_test_config.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import sys +import unittest + +import datadog_api_client.v1 +from datadog_api_client.v1.model.synthetics_assertion import SyntheticsAssertion +from datadog_api_client.v1.model.synthetics_browser_variable import SyntheticsBrowserVariable +from datadog_api_client.v1.model.synthetics_test_request import SyntheticsTestRequest + +globals()["SyntheticsAssertion"] = SyntheticsAssertion +globals()["SyntheticsBrowserVariable"] = SyntheticsBrowserVariable +globals()["SyntheticsTestRequest"] = SyntheticsTestRequest +from datadog_api_client.v1.model.synthetics_browser_test_config import SyntheticsBrowserTestConfig + + +class TestSyntheticsBrowserTestConfig(unittest.TestCase): + """SyntheticsBrowserTestConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSyntheticsBrowserTestConfig(self): + """Test SyntheticsBrowserTestConfig""" + # FIXME: construct object with mandatory attributes with example values + # model = SyntheticsBrowserTestConfig() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/v1/test_synthetics_browser_test_type.py b/tests/v1/test_synthetics_browser_test_type.py new file mode 100644 index 0000000000..a86cb80d2a --- /dev/null +++ b/tests/v1/test_synthetics_browser_test_type.py @@ -0,0 +1,30 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. + + +import sys +import unittest + +import datadog_api_client.v1 +from datadog_api_client.v1.model.synthetics_browser_test_type import SyntheticsBrowserTestType + + +class TestSyntheticsBrowserTestType(unittest.TestCase): + """SyntheticsBrowserTestType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSyntheticsBrowserTestType(self): + """Test SyntheticsBrowserTestType""" + # FIXME: construct object with mandatory attributes with example values + # model = SyntheticsBrowserTestType() # noqa: E501 + pass + + +if __name__ == "__main__": + unittest.main()