Skip to content

Commit f1b058a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add mandatory filter env parameter to APM services endpoint (DataDog#3705)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent fc19c62 commit f1b058a

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71059,6 +71059,14 @@ paths:
7105971059
/api/v2/apm/services:
7106071060
get:
7106171061
operationId: GetServiceList
71062+
parameters:
71063+
- description: Filter services by environment. Can be set to `*` to return all
71064+
services across all environments.
71065+
in: query
71066+
name: filter[env]
71067+
required: true
71068+
schema:
71069+
type: string
7106271070
responses:
7106371071
'200':
7106471072
content:

api/datadogV2/api_apm.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type APMApi datadog.Service
1717

1818
// GetServiceList Get service list.
1919

20-
func (a *APMApi) GetServiceList(ctx _context.Context) (ServiceList, *_nethttp.Response, error) {
20+
func (a *APMApi) GetServiceList(ctx _context.Context, filterEnv string) (ServiceList, *_nethttp.Response, error) {
2121
var (
2222
localVarHTTPMethod = _nethttp.MethodGet
2323
localVarPostBody interface{}
@@ -34,6 +34,7 @@ func (a *APMApi) GetServiceList(ctx _context.Context) (ServiceList, *_nethttp.Re
3434
localVarHeaderParams := make(map[string]string)
3535
localVarQueryParams := _neturl.Values{}
3636
localVarFormParams := _neturl.Values{}
37+
localVarQueryParams.Add("filter[env]", datadog.ParameterToString(filterEnv, ""))
3738
localVarHeaderParams["Accept"] = "application/json"
3839

3940
if a.Client.Cfg.DelegatedTokenConfig != nil {

examples/v2/apm/GetServiceList.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func main() {
1717
configuration := datadog.NewConfiguration()
1818
apiClient := datadog.NewAPIClient(configuration)
1919
api := datadogV2.NewAPMApi(apiClient)
20-
resp, r, err := api.GetServiceList(ctx)
20+
resp, r, err := api.GetServiceList(ctx, "filter[env]")
2121

2222
if err != nil {
2323
fmt.Fprintf(os.Stderr, "Error when calling `APMApi.GetServiceList`: %v\n", err)

tests/scenarios/features/v2/apm.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ Feature: APM
99
And a valid "appKeyAuth" key in the system
1010
And an instance of "APM" API
1111
And new "GetServiceList" request
12+
And request contains "filter[env]" parameter from "REPLACE.ME"
1213
When the request is sent
1314
Then the response status is 200 OK

0 commit comments

Comments
 (0)