Skip to content

Commit

Permalink
Update synthetics test to contain latest features (#375)
Browse files Browse the repository at this point in the history
* Update to use new target objects

* Add new target

* Remove the integer target

* Add test showing failure

* Regenerate client from commit 44c5568 of spec repo

Co-authored-by: Thomas Hervé <thomas.herve@datadoghq.com>
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
  • Loading branch information
3 people authored Jul 8, 2020
1 parent cbb8a7a commit de22f80
Show file tree
Hide file tree
Showing 19 changed files with 1,319 additions and 267 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.2.0",
"regenerated": "2020-07-02 22:52:46.497889",
"spec_repo_commit": "4d84e86"
"regenerated": "2020-07-08 07:59:40.929470",
"spec_repo_commit": "44c5568"
},
"v2": {
"apigentools_version": "1.2.0",
"regenerated": "2020-07-02 22:52:51.322419",
"spec_repo_commit": "4d84e86"
"regenerated": "2020-07-08 07:59:45.823088",
"spec_repo_commit": "44c5568"
}
}
}
8 changes: 8 additions & 0 deletions api/v1/datadog/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,11 @@ docs/SyntheticsAPITestResultShort.md
docs/SyntheticsAPITestResultShortResult.md
docs/SyntheticsApi.md
docs/SyntheticsAssertion.md
docs/SyntheticsAssertionJSONPathOperator.md
docs/SyntheticsAssertionJSONPathTarget.md
docs/SyntheticsAssertionJSONPathTargetTarget.md
docs/SyntheticsAssertionOperator.md
docs/SyntheticsAssertionTarget.md
docs/SyntheticsAssertionType.md
docs/SyntheticsBrowserError.md
docs/SyntheticsBrowserErrorType.md
Expand Down Expand Up @@ -670,7 +674,11 @@ model_synthetics_api_test_result_full_check.go
model_synthetics_api_test_result_short.go
model_synthetics_api_test_result_short_result.go
model_synthetics_assertion.go
model_synthetics_assertion_json_path_operator.go
model_synthetics_assertion_json_path_target.go
model_synthetics_assertion_json_path_target_target.go
model_synthetics_assertion_operator.go
model_synthetics_assertion_target.go
model_synthetics_assertion_type.go
model_synthetics_browser_error.go
model_synthetics_browser_error_type.go
Expand Down
4 changes: 4 additions & 0 deletions api/v1/datadog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,11 @@ Class | Method | HTTP request | Description
- [SyntheticsAPITestResultShort](docs/SyntheticsAPITestResultShort.md)
- [SyntheticsAPITestResultShortResult](docs/SyntheticsAPITestResultShortResult.md)
- [SyntheticsAssertion](docs/SyntheticsAssertion.md)
- [SyntheticsAssertionJSONPathOperator](docs/SyntheticsAssertionJSONPathOperator.md)
- [SyntheticsAssertionJSONPathTarget](docs/SyntheticsAssertionJSONPathTarget.md)
- [SyntheticsAssertionJSONPathTargetTarget](docs/SyntheticsAssertionJSONPathTargetTarget.md)
- [SyntheticsAssertionOperator](docs/SyntheticsAssertionOperator.md)
- [SyntheticsAssertionTarget](docs/SyntheticsAssertionTarget.md)
- [SyntheticsAssertionType](docs/SyntheticsAssertionType.md)
- [SyntheticsBrowserError](docs/SyntheticsBrowserError.md)
- [SyntheticsBrowserErrorType](docs/SyntheticsBrowserErrorType.md)
Expand Down
54 changes: 49 additions & 5 deletions api/v1/datadog/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12396,17 +12396,28 @@ components:
SyntheticsAssertion:
description: |-
Object describing the assertions type, their associated operator,
which property they apply , and upon which target.
which property they apply, and upon which target.
oneOf:
- $ref: '#/components/schemas/SyntheticsAssertionTarget'
- $ref: '#/components/schemas/SyntheticsAssertionJSONPathTarget'
type: object
SyntheticsAssertionJSONPathOperator:
description: Assertion operator to apply.
enum:
- validatesJSONPath
type: string
x-enum-varnames:
- VALIDATES_JSON_PATH
SyntheticsAssertionJSONPathTarget:
description: An assertion for the `validatesJSONPath` operator.
properties:
operator:
$ref: '#/components/schemas/SyntheticsAssertionOperator'
$ref: '#/components/schemas/SyntheticsAssertionJSONPathOperator'
property:
description: The associated assertion property.
type: string
target:
description: Target to apply the assertion to. It can be a string, a number,
or a Date.
type: object
$ref: '#/components/schemas/SyntheticsAssertionJSONPathTarget_target'
type:
$ref: '#/components/schemas/SyntheticsAssertionType'
required:
Expand All @@ -12421,21 +12432,42 @@ components:
- is
- isNot
- lessThan
- moreThan
- matches
- doesNotMatch
- validates
- isInMoreThan
- isInLessThan
type: string
x-enum-varnames:
- CONTAINS
- DOES_NOT_CONTAIN
- IS
- IS_NOT
- LESS_THAN
- MORE_THAN
- MATCHES
- DOES_NOT_MATCH
- VALIDATES
- IS_IN_MORE_DAYS_THAN
- IS_IN_LESS_DAYS_THAN
SyntheticsAssertionTarget:
description: An assertion which uses a simple target.
properties:
operator:
$ref: '#/components/schemas/SyntheticsAssertionOperator'
property:
description: The associated assertion property.
type: string
target:
description: Value used by the operator.
type: object
type:
$ref: '#/components/schemas/SyntheticsAssertionType'
required:
- operator
- type
type: object
SyntheticsAssertionType:
description: Type of the assertion.
enum:
Expand Down Expand Up @@ -17637,6 +17669,18 @@ components:
properties:
timings:
$ref: '#/components/schemas/SyntheticsTiming'
SyntheticsAssertionJSONPathTarget_target:
description: Composed target for `validatesJSONPath` operator.
properties:
jsonPath:
description: The JSON path to assert.
type: string
operator:
description: The specific operator to use on the path.
type: string
targetValue:
description: The path target value to compare to.
type: object
SyntheticsBrowserTestResultFull_check:
description: Object describing the browser test configuration.
example:
Expand Down
4 changes: 2 additions & 2 deletions api/v1/datadog/docs/SyntheticsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func main() {
},
)

body := datadog.SyntheticsTestDetails{Config: datadog.SyntheticsTestConfig{Assertions: []SyntheticsAssertion{datadog.SyntheticsAssertion{Operator: datadog.SyntheticsAssertionOperator{}, Property: "Property_example", Target: 123, Type: datadog.SyntheticsAssertionType{}}), Request: datadog.SyntheticsTestRequest{BasicAuth: datadog.SyntheticsTestRequest_basicAuth{Password: "Password_example", Username: "Username_example"}, Body: "Body_example", Headers: map[string]string{ "Key" = "Value" }, Host: "Host_example", Method: datadog.HTTPMethod{}, Port: int64(123), Query: 123, Timeout: 123, Url: "Url_example"}, Variables: []SyntheticsBrowserVariable{datadog.SyntheticsBrowserVariable{Example: "Example_example", Id: "Id_example", Name: "Name_example", Pattern: "Pattern_example", Type: datadog.SyntheticsBrowserVariableType{}})}, Locations: []string{"Locations_example"), Message: "Message_example", MonitorId: int64(123), Name: "Name_example", Options: datadog.SyntheticsTestOptions{AcceptSelfSigned: false, AllowInsecure: false, DeviceIds: []SyntheticsDeviceID{datadog.SyntheticsDeviceID{}), FollowRedirects: false, MinFailureDuration: int64(123), MinLocationFailed: int64(123), Retry: datadog.SyntheticsTestOptions_retry{Count: int64(123), Interval: 123}, TickEvery: datadog.SyntheticsTickInterval{}}, PublicId: "PublicId_example", Status: datadog.SyntheticsTestPauseStatus{}, Steps: []SyntheticsStep{datadog.SyntheticsStep{AllowFailure: false, Name: "Name_example", Params: 123, Timeout: 123, Type: datadog.SyntheticsStepType{}}), Subtype: datadog.SyntheticsTestDetailsSubType{}, Tags: []string{"Tags_example"), Type: datadog.SyntheticsTestDetailsType{}} // SyntheticsTestDetails | Details of the test to create.
body := datadog.SyntheticsTestDetails{Config: datadog.SyntheticsTestConfig{Assertions: []SyntheticsAssertion{datadog.SyntheticsAssertion{Operator: datadog.SyntheticsAssertionJSONPathOperator{}, Property: "Property_example", Target: datadog.SyntheticsAssertionJSONPathTarget_target{JsonPath: "JsonPath_example", Operator: "Operator_example", TargetValue: 123}, Type: datadog.SyntheticsAssertionType{}}), Request: datadog.SyntheticsTestRequest{BasicAuth: datadog.SyntheticsTestRequest_basicAuth{Password: "Password_example", Username: "Username_example"}, Body: "Body_example", Headers: map[string]string{ "Key" = "Value" }, Host: "Host_example", Method: datadog.HTTPMethod{}, Port: int64(123), Query: 123, Timeout: 123, Url: "Url_example"}, Variables: []SyntheticsBrowserVariable{datadog.SyntheticsBrowserVariable{Example: "Example_example", Id: "Id_example", Name: "Name_example", Pattern: "Pattern_example", Type: datadog.SyntheticsBrowserVariableType{}})}, Locations: []string{"Locations_example"), Message: "Message_example", MonitorId: int64(123), Name: "Name_example", Options: datadog.SyntheticsTestOptions{AcceptSelfSigned: false, AllowInsecure: false, DeviceIds: []SyntheticsDeviceID{datadog.SyntheticsDeviceID{}), FollowRedirects: false, MinFailureDuration: int64(123), MinLocationFailed: int64(123), Retry: datadog.SyntheticsTestOptions_retry{Count: int64(123), Interval: 123}, TickEvery: datadog.SyntheticsTickInterval{}}, PublicId: "PublicId_example", Status: datadog.SyntheticsTestPauseStatus{}, Steps: []SyntheticsStep{datadog.SyntheticsStep{AllowFailure: false, Name: "Name_example", Params: 123, Timeout: 123, Type: datadog.SyntheticsStepType{}}), Subtype: datadog.SyntheticsTestDetailsSubType{}, Tags: []string{"Tags_example"), Type: datadog.SyntheticsTestDetailsType{}} // SyntheticsTestDetails | Details of the test to create.

configuration := datadog.NewConfiguration()
api_client := datadog.NewAPIClient(configuration)
Expand Down Expand Up @@ -881,7 +881,7 @@ func main() {
)

publicId := "publicId_example" // string | The public ID of the test to get details from.
body := datadog.SyntheticsTestDetails{Config: datadog.SyntheticsTestConfig{Assertions: []SyntheticsAssertion{datadog.SyntheticsAssertion{Operator: datadog.SyntheticsAssertionOperator{}, Property: "Property_example", Target: 123, Type: datadog.SyntheticsAssertionType{}}), Request: datadog.SyntheticsTestRequest{BasicAuth: datadog.SyntheticsTestRequest_basicAuth{Password: "Password_example", Username: "Username_example"}, Body: "Body_example", Headers: map[string]string{ "Key" = "Value" }, Host: "Host_example", Method: datadog.HTTPMethod{}, Port: int64(123), Query: 123, Timeout: 123, Url: "Url_example"}, Variables: []SyntheticsBrowserVariable{datadog.SyntheticsBrowserVariable{Example: "Example_example", Id: "Id_example", Name: "Name_example", Pattern: "Pattern_example", Type: datadog.SyntheticsBrowserVariableType{}})}, Locations: []string{"Locations_example"), Message: "Message_example", MonitorId: int64(123), Name: "Name_example", Options: datadog.SyntheticsTestOptions{AcceptSelfSigned: false, AllowInsecure: false, DeviceIds: []SyntheticsDeviceID{datadog.SyntheticsDeviceID{}), FollowRedirects: false, MinFailureDuration: int64(123), MinLocationFailed: int64(123), Retry: datadog.SyntheticsTestOptions_retry{Count: int64(123), Interval: 123}, TickEvery: datadog.SyntheticsTickInterval{}}, PublicId: "PublicId_example", Status: datadog.SyntheticsTestPauseStatus{}, Steps: []SyntheticsStep{datadog.SyntheticsStep{AllowFailure: false, Name: "Name_example", Params: 123, Timeout: 123, Type: datadog.SyntheticsStepType{}}), Subtype: datadog.SyntheticsTestDetailsSubType{}, Tags: []string{"Tags_example"), Type: datadog.SyntheticsTestDetailsType{}} // SyntheticsTestDetails | New test details to be saved.
body := datadog.SyntheticsTestDetails{Config: datadog.SyntheticsTestConfig{Assertions: []SyntheticsAssertion{datadog.SyntheticsAssertion{Operator: datadog.SyntheticsAssertionJSONPathOperator{}, Property: "Property_example", Target: datadog.SyntheticsAssertionJSONPathTarget_target{JsonPath: "JsonPath_example", Operator: "Operator_example", TargetValue: 123}, Type: datadog.SyntheticsAssertionType{}}), Request: datadog.SyntheticsTestRequest{BasicAuth: datadog.SyntheticsTestRequest_basicAuth{Password: "Password_example", Username: "Username_example"}, Body: "Body_example", Headers: map[string]string{ "Key" = "Value" }, Host: "Host_example", Method: datadog.HTTPMethod{}, Port: int64(123), Query: 123, Timeout: 123, Url: "Url_example"}, Variables: []SyntheticsBrowserVariable{datadog.SyntheticsBrowserVariable{Example: "Example_example", Id: "Id_example", Name: "Name_example", Pattern: "Pattern_example", Type: datadog.SyntheticsBrowserVariableType{}})}, Locations: []string{"Locations_example"), Message: "Message_example", MonitorId: int64(123), Name: "Name_example", Options: datadog.SyntheticsTestOptions{AcceptSelfSigned: false, AllowInsecure: false, DeviceIds: []SyntheticsDeviceID{datadog.SyntheticsDeviceID{}), FollowRedirects: false, MinFailureDuration: int64(123), MinLocationFailed: int64(123), Retry: datadog.SyntheticsTestOptions_retry{Count: int64(123), Interval: 123}, TickEvery: datadog.SyntheticsTickInterval{}}, PublicId: "PublicId_example", Status: datadog.SyntheticsTestPauseStatus{}, Steps: []SyntheticsStep{datadog.SyntheticsStep{AllowFailure: false, Name: "Name_example", Params: 123, Timeout: 123, Type: datadog.SyntheticsStepType{}}), Subtype: datadog.SyntheticsTestDetailsSubType{}, Tags: []string{"Tags_example"), Type: datadog.SyntheticsTestDetailsType{}} // SyntheticsTestDetails | New test details to be saved.

configuration := datadog.NewConfiguration()
api_client := datadog.NewAPIClient(configuration)
Expand Down
18 changes: 9 additions & 9 deletions api/v1/datadog/docs/SyntheticsAssertion.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Operator** | Pointer to [**SyntheticsAssertionOperator**](SyntheticsAssertionOperator.md) | |
**Operator** | Pointer to [**SyntheticsAssertionJSONPathOperator**](SyntheticsAssertionJSONPathOperator.md) | |
**Property** | Pointer to **string** | The associated assertion property. | [optional]
**Target** | Pointer to **interface{}** | Target to apply the assertion to. It can be a string, a number, or a Date. | [optional]
**Target** | Pointer to [**SyntheticsAssertionJSONPathTargetTarget**](SyntheticsAssertionJSONPathTarget_target.md) | | [optional]
**Type** | Pointer to [**SyntheticsAssertionType**](SyntheticsAssertionType.md) | |

## Methods

### NewSyntheticsAssertion

`func NewSyntheticsAssertion(operator SyntheticsAssertionOperator, type_ SyntheticsAssertionType, ) *SyntheticsAssertion`
`func NewSyntheticsAssertion(operator SyntheticsAssertionJSONPathOperator, type_ SyntheticsAssertionType, ) *SyntheticsAssertion`

NewSyntheticsAssertion instantiates a new SyntheticsAssertion object
This constructor will assign default values to properties that have it defined,
Expand All @@ -30,20 +30,20 @@ but it doesn't guarantee that properties required by API are set

### GetOperator

`func (o *SyntheticsAssertion) GetOperator() SyntheticsAssertionOperator`
`func (o *SyntheticsAssertion) GetOperator() SyntheticsAssertionJSONPathOperator`

GetOperator returns the Operator field if non-nil, zero value otherwise.

### GetOperatorOk

`func (o *SyntheticsAssertion) GetOperatorOk() (*SyntheticsAssertionOperator, bool)`
`func (o *SyntheticsAssertion) GetOperatorOk() (*SyntheticsAssertionJSONPathOperator, bool)`

GetOperatorOk returns a tuple with the Operator field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetOperator

`func (o *SyntheticsAssertion) SetOperator(v SyntheticsAssertionOperator)`
`func (o *SyntheticsAssertion) SetOperator(v SyntheticsAssertionJSONPathOperator)`

SetOperator sets Operator field to given value.

Expand Down Expand Up @@ -75,20 +75,20 @@ HasProperty returns a boolean if a field has been set.

### GetTarget

`func (o *SyntheticsAssertion) GetTarget() interface{}`
`func (o *SyntheticsAssertion) GetTarget() SyntheticsAssertionJSONPathTargetTarget`

GetTarget returns the Target field if non-nil, zero value otherwise.

### GetTargetOk

`func (o *SyntheticsAssertion) GetTargetOk() (*interface{}, bool)`
`func (o *SyntheticsAssertion) GetTargetOk() (*SyntheticsAssertionJSONPathTargetTarget, bool)`

GetTargetOk returns a tuple with the Target field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetTarget

`func (o *SyntheticsAssertion) SetTarget(v interface{})`
`func (o *SyntheticsAssertion) SetTarget(v SyntheticsAssertionJSONPathTargetTarget)`

SetTarget sets Target field to given value.

Expand Down
11 changes: 11 additions & 0 deletions api/v1/datadog/docs/SyntheticsAssertionJSONPathOperator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SyntheticsAssertionJSONPathOperator

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading

0 comments on commit de22f80

Please sign in to comment.