Skip to content

Commit

Permalink
Add filter parameter for listing teams and services (#564)
Browse files Browse the repository at this point in the history
* Fix incident related tests

* Regenerate client from commit 6a8fa99 of spec repo

Co-authored-by: Jiri Kuncar <jiri.kuncar@gmail.com>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
  • Loading branch information
3 people authored Nov 12, 2020
1 parent d599606 commit 35600d5
Show file tree
Hide file tree
Showing 15 changed files with 239 additions and 116 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.3.0",
"regenerated": "2020-11-11 14:04:31.546119",
"spec_repo_commit": "99c92ca"
"regenerated": "2020-11-12 14:38:27.645114",
"spec_repo_commit": "6a8fa99"
},
"v2": {
"apigentools_version": "1.3.0",
"regenerated": "2020-11-11 14:04:36.556885",
"spec_repo_commit": "99c92ca"
"regenerated": "2020-11-12 14:38:33.381059",
"spec_repo_commit": "6a8fa99"
}
}
}
4 changes: 2 additions & 2 deletions api/v2/datadog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ Class | Method | HTTP request | Description
*IncidentServicesApi* | [**CreateIncidentService**](docs/IncidentServicesApi.md#createincidentservice) | **Post** /api/v2/services | Create a new incident service
*IncidentServicesApi* | [**DeleteIncidentService**](docs/IncidentServicesApi.md#deleteincidentservice) | **Delete** /api/v2/services/{service_id} | Delete an existing incident service
*IncidentServicesApi* | [**GetIncidentService**](docs/IncidentServicesApi.md#getincidentservice) | **Get** /api/v2/services/{service_id} | Get details of an incident service
*IncidentServicesApi* | [**GetIncidentServices**](docs/IncidentServicesApi.md#getincidentservices) | **Get** /api/v2/services | Get a list of all incident services
*IncidentServicesApi* | [**ListIncidentServices**](docs/IncidentServicesApi.md#listincidentservices) | **Get** /api/v2/services | Get a list of all incident services
*IncidentServicesApi* | [**UpdateIncidentService**](docs/IncidentServicesApi.md#updateincidentservice) | **Patch** /api/v2/services/{service_id} | Update an existing incident service
*IncidentTeamsApi* | [**CreateIncidentTeam**](docs/IncidentTeamsApi.md#createincidentteam) | **Post** /api/v2/teams | Create a new incident team
*IncidentTeamsApi* | [**DeleteIncidentTeam**](docs/IncidentTeamsApi.md#deleteincidentteam) | **Delete** /api/v2/teams/{team_id} | Delete an existing incident team
*IncidentTeamsApi* | [**GetIncidentTeam**](docs/IncidentTeamsApi.md#getincidentteam) | **Get** /api/v2/teams/{team_id} | Get details of an incident team
*IncidentTeamsApi* | [**GetIncidentTeams**](docs/IncidentTeamsApi.md#getincidentteams) | **Get** /api/v2/teams | Get a list of all incident teams
*IncidentTeamsApi* | [**ListIncidentTeams**](docs/IncidentTeamsApi.md#listincidentteams) | **Get** /api/v2/teams | Get a list of all incident teams
*IncidentTeamsApi* | [**UpdateIncidentTeam**](docs/IncidentTeamsApi.md#updateincidentteam) | **Patch** /api/v2/teams/{team_id} | Update an existing incident team
*LogsApi* | [**AggregateLogs**](docs/LogsApi.md#aggregatelogs) | **Post** /api/v2/logs/analytics/aggregate | Aggregate events
*LogsApi* | [**ListLogs**](docs/LogsApi.md#listlogs) | **Post** /api/v2/logs/events/search | Get a list of logs
Expand Down
42 changes: 40 additions & 2 deletions api/v2/datadog/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ paths:
description: Get all incident services uploaded for the requesting user's organization.
If the `include[users]` query parameter is provided, the included attribute
will contain the users related to these incident services.
operationId: GetIncidentServices
operationId: ListIncidentServices
parameters:
- description: Specifies which types of related objects should be included in
the response.
Expand Down Expand Up @@ -1720,6 +1720,15 @@ paths:
format: int64
type: integer
style: form
- description: A search query that filters services by name.
explode: true
in: query
name: filter
required: false
schema:
example: ExampleServiceName
type: string
style: form
responses:
"200":
content:
Expand Down Expand Up @@ -1976,7 +1985,7 @@ paths:
description: Get all incident teams for the requesting user's organization.
If the `include[users]` query parameter is provided, the included attribute
will contain the users related to these incident teams.
operationId: GetIncidentTeams
operationId: ListIncidentTeams
parameters:
- description: Specifies which types of related objects should be included in
the response.
Expand Down Expand Up @@ -2009,6 +2018,15 @@ paths:
format: int64
type: integer
style: form
- description: A search query that filters teams by name.
explode: true
in: query
name: filter
required: false
schema:
example: ExampleTeamName
type: string
style: form
responses:
"200":
content:
Expand Down Expand Up @@ -2684,6 +2702,16 @@ components:
- users
type: string
style: form
IncidentServiceSearchQueryParameter:
description: A search query that filters services by name.
explode: true
in: query
name: filter
required: false
schema:
example: ExampleServiceName
type: string
style: form
IncidentTeamIDPathParameter:
description: The ID of the incident team.
explode: false
Expand All @@ -2705,6 +2733,16 @@ components:
- users
type: string
style: form
IncidentTeamSearchQueryParameter:
description: A search query that filters teams by name.
explode: true
in: query
name: filter
required: false
schema:
example: ExampleTeamName
type: string
style: form
PageNumber:
description: Specific page number to return.
explode: true
Expand Down
36 changes: 22 additions & 14 deletions api/v2/datadog/api_incident_services.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 22 additions & 14 deletions api/v2/datadog/api_incident_teams.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/v2/datadog/configuration.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 11 additions & 9 deletions api/v2/datadog/docs/IncidentServicesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Method | HTTP request | Description
[**CreateIncidentService**](IncidentServicesApi.md#CreateIncidentService) | **Post** /api/v2/services | Create a new incident service
[**DeleteIncidentService**](IncidentServicesApi.md#DeleteIncidentService) | **Delete** /api/v2/services/{service_id} | Delete an existing incident service
[**GetIncidentService**](IncidentServicesApi.md#GetIncidentService) | **Get** /api/v2/services/{service_id} | Get details of an incident service
[**GetIncidentServices**](IncidentServicesApi.md#GetIncidentServices) | **Get** /api/v2/services | Get a list of all incident services
[**ListIncidentServices**](IncidentServicesApi.md#ListIncidentServices) | **Get** /api/v2/services | Get a list of all incident services
[**UpdateIncidentService**](IncidentServicesApi.md#UpdateIncidentService) | **Patch** /api/v2/services/{service_id} | Update an existing incident service


Expand Down Expand Up @@ -263,9 +263,9 @@ Name | Type | Description | Notes
[[Back to README]](../README.md)


## GetIncidentServices
## ListIncidentServices

> IncidentServicesResponse GetIncidentServices(ctx).Include(include).PageSize(pageSize).PageOffset(pageOffset).Execute()
> IncidentServicesResponse ListIncidentServices(ctx).Include(include).PageSize(pageSize).PageOffset(pageOffset).Filter(filter).Execute()
Get a list of all incident services

Expand Down Expand Up @@ -300,18 +300,19 @@ func main() {
include := "include_example" // string | Specifies which types of related objects should be included in the response. (optional)
pageSize := 987 // int64 | Size for a given page. (optional) (default to 10)
pageOffset := 987 // int64 | Specific offset to use as the beginning of the returned page. (optional) (default to 0)
filter := "filter_example" // string | A search query that filters services by name. (optional)

configuration := datadog.NewConfiguration()
configuration.SetUnstableOperationEnabled("GetIncidentServices", true)
configuration.SetUnstableOperationEnabled("ListIncidentServices", true)

api_client := datadog.NewAPIClient(configuration)
resp, r, err := api_client.IncidentServicesApi.GetIncidentServices(ctx).Include(include).PageSize(pageSize).PageOffset(pageOffset).Execute()
resp, r, err := api_client.IncidentServicesApi.ListIncidentServices(ctx).Include(include).PageSize(pageSize).PageOffset(pageOffset).Filter(filter).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IncidentServicesApi.GetIncidentServices``: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `IncidentServicesApi.ListIncidentServices``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetIncidentServices`: IncidentServicesResponse
fmt.Fprintf(os.Stdout, "Response from `IncidentServicesApi.GetIncidentServices`: %v\n", resp)
// response from `ListIncidentServices`: IncidentServicesResponse
fmt.Fprintf(os.Stdout, "Response from `IncidentServicesApi.ListIncidentServices`: %v\n", resp)
}
```

Expand All @@ -321,14 +322,15 @@ func main() {

### Other Parameters

Other parameters are passed through a pointer to a apiGetIncidentServicesRequest struct via the builder pattern
Other parameters are passed through a pointer to a apiListIncidentServicesRequest struct via the builder pattern


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**include** | **string** | Specifies which types of related objects should be included in the response. |
**pageSize** | **int64** | Size for a given page. | [default to 10]
**pageOffset** | **int64** | Specific offset to use as the beginning of the returned page. | [default to 0]
**filter** | **string** | A search query that filters services by name. |

### Return type

Expand Down
Loading

0 comments on commit 35600d5

Please sign in to comment.