-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for dashboard listing pagination parameters (#2165)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
- Loading branch information
1 parent
584ab4a
commit 6d5f22d
Showing
7 changed files
with
175 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Get all dashboards returns "OK" response with pagination | ||
|
||
package main | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/DataDog/datadog-api-client-go/v2/api/datadog" | ||
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" | ||
) | ||
|
||
func main() { | ||
ctx := datadog.NewDefaultContext(context.Background()) | ||
configuration := datadog.NewConfiguration() | ||
apiClient := datadog.NewAPIClient(configuration) | ||
api := datadogV1.NewDashboardsApi(apiClient) | ||
resp, _ := api.ListDashboardsWithPagination(ctx, *datadogV1.NewListDashboardsOptionalParameters().WithCount(2)) | ||
|
||
for paginationResult := range resp { | ||
if paginationResult.Error != nil { | ||
fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.ListDashboards`: %v\n", paginationResult.Error) | ||
} | ||
responseContent, _ := json.MarshalIndent(paginationResult.Item, "", " ") | ||
fmt.Fprintf(os.Stdout, "%s\n", responseContent) | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...Feature_Dashboards/Scenario_Get_all_dashboards_returns_OK_response_with_pagination.freeze
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2023-09-04T12:26:51.389Z |
44 changes: 44 additions & 0 deletions
44
...1/Feature_Dashboards/Scenario_Get_all_dashboards_returns_OK_response_with_pagination.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
interactions: | ||
- request: | ||
body: '' | ||
form: {} | ||
headers: | ||
Accept: | ||
- application/json | ||
method: GET | ||
url: https://api.datadoghq.com/api/v1/dashboard?count=2 | ||
response: | ||
body: '{"dashboards":[{"id":"5vp-fxm-s4j","title":"PCF Testing","description":null,"layout_type":"ordered","url":"/dashboard/5vp-fxm-s4j/pcf-testing","is_read_only":false,"created_at":"2022-06-08T10:40:29.941695+00:00","modified_at":"2023-07-27T12:26:28.359080+00:00","author_handle":"frog@datadoghq.com","deleted_at":null},{"id":"ubf-m9i-gms","title":"OpenStack | ||
Controller Overview","description":"## OpenStack Controller - Overview\n\nPreset | ||
dashboard for the OpenStack Controller integration. Used for OpenStack deployments | ||
v13 and higher. \n\n[See integration docs for more details](https://docs.datadoghq.com/integrations/openstack_controller/)","layout_type":"ordered","url":"/dashboard/ubf-m9i-gms/openstack-controller-overview","is_read_only":false,"created_at":"2023-04-28T19:16:35.964720+00:00","modified_at":"2023-08-07T13:53:31.924789+00:00","author_handle":"frog@datadoghq.com","deleted_at":null}]} | ||
' | ||
code: 200 | ||
duration: '' | ||
headers: | ||
Content-Type: | ||
- application/json | ||
status: 200 OK | ||
- request: | ||
body: '' | ||
form: {} | ||
headers: | ||
Accept: | ||
- application/json | ||
method: GET | ||
url: https://api.datadoghq.com/api/v1/dashboard?count=2&start=2 | ||
response: | ||
body: '{"dashboards":[{"id":"ja7-nhx-7zs","title":"OpenStack Controller Overview | ||
[Default Microversion]","description":"## OpenStack Controller - Overview\n\nPreset | ||
dashboard for the OpenStack Controller integration. Used for OpenStack deployments | ||
v13 and higher. \n\n[See integration docs for more details](https://docs.datadoghq.com/integrations/openstack_controller/)","layout_type":"ordered","url":"/dashboard/ja7-nhx-7zs/openstack-controller-overview-default-microversion","is_read_only":false,"created_at":"2023-08-29T19:56:15.999851+00:00","modified_at":"2023-08-29T20:12:33.385536+00:00","author_handle":"frog@datadoghq.com","deleted_at":null}]} | ||
' | ||
code: 200 | ||
duration: '' | ||
headers: | ||
Content-Type: | ||
- application/json | ||
status: 200 OK | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters