diff --git a/.apigentools-info b/.apigentools-info index f1a64ef9705b..f7e8711d3d75 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-06 19:22:02.226451", - "spec_repo_commit": "1faa96a2" + "regenerated": "2025-05-07 17:07:22.766765", + "spec_repo_commit": "a1235a0d" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-05-06 19:22:02.241650", - "spec_repo_commit": "1faa96a2" + "regenerated": "2025-05-07 17:07:22.783724", + "spec_repo_commit": "a1235a0d" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d47818ba445a..af9c9a98220b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -50925,22 +50925,8 @@ paths: description: Get the list of devices. operationId: ListDevices parameters: - - description: The page number to fetch. - example: 0 - in: query - name: page[number] - required: false - schema: - format: int64 - type: integer - - description: The number of devices to return per page. - example: 10 - in: query - name: page[size] - required: false - schema: - format: int64 - type: integer + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' - description: The field to sort the devices by. example: status in: query @@ -50971,6 +50957,10 @@ paths: summary: Get the list of devices tags: - Network Device Monitoring + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data /api/v2/ndm/devices/{device_id}: get: description: Get the device details. diff --git a/cassettes/features/v2/on-call/Create-on-call-escalation-policy-returns-Created-response.frozen b/cassettes/features/v2/on-call/Create-on-call-escalation-policy-returns-Created-response.frozen index 57dea2bb5238..4200b1edc2d9 100644 --- a/cassettes/features/v2/on-call/Create-on-call-escalation-policy-returns-Created-response.frozen +++ b/cassettes/features/v2/on-call/Create-on-call-escalation-policy-returns-Created-response.frozen @@ -1 +1 @@ -2025-04-24T02:49:21.008Z \ No newline at end of file +2025-04-24T03:17:05.259Z \ No newline at end of file diff --git a/cassettes/features/v2/on-call/Create-on-call-escalation-policy-returns-Created-response.yml b/cassettes/features/v2/on-call/Create-on-call-escalation-policy-returns-Created-response.yml index 92f81452310d..6463bc8a58df 100644 --- a/cassettes/features/v2/on-call/Create-on-call-escalation-policy-returns-Created-response.yml +++ b/cassettes/features/v2/on-call/Create-on-call-escalation-policy-returns-Created-response.yml @@ -1,10 +1,10 @@ http_interactions: -- recorded_at: Thu, 24 Apr 2025 02:49:21 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:05 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T02:49:21.008Z","end_date":"2025-05-04T02:49:21.008Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T02:49:21.008Z"}],"name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745462961","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' + string: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T03:17:05.259Z","end_date":"2025-05-04T03:17:05.259Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T03:17:05.259Z"}],"name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745464625","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' headers: Accept: - application/json @@ -15,18 +15,18 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"982c5000-f586-47ba-8a24-68cbfcb69dd8","type":"schedules","attributes":{"name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745462961","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"e0120c74-ba79-45ce-a6ee-23805f0b427a","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"2a44a887-add2-47f7-9535-92a2a8ebea79","type":"schedules","attributes":{"name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745464625","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"accb6605-37be-410c-86ad-a7d3400919a3","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: Content-Type: - application/vnd.api+json status: code: 201 message: Created -- recorded_at: Thu, 24 Apr 2025 02:49:21 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:05 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"handle":"test-handle-31c96645156f4753","name":"test-name-31c96645156f4753"},"type":"team"}}' + string: '{"data":{"attributes":{"handle":"test-handle-e9912af3975c2380","name":"test-name-e9912af3975c2380"},"type":"team"}}' headers: Accept: - application/json @@ -37,7 +37,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"team","id":"1a2f4aba-af9a-4b7c-bfc1-27147b24f69a","attributes":{"name":"test-name-31c96645156f4753","handle":"test-handle-31c96645156f4753","summary":null,"description":null,"avatar":null,"banner":9,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T02:49:22.446146+00:00","modified_at":"2025-04-24T02:49:22.446154+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/1a2f4aba-af9a-4b7c-bfc1-27147b24f69a/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/1a2f4aba-af9a-4b7c-bfc1-27147b24f69a/permission-settings"}}}}} + string: '{"data":{"type":"team","id":"15667dfa-83d1-4a17-a100-d8474fdb723d","attributes":{"name":"test-name-e9912af3975c2380","handle":"test-handle-e9912af3975c2380","summary":null,"description":null,"avatar":null,"banner":1,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T03:17:06.086645+00:00","modified_at":"2025-04-24T03:17:06.086653+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/15667dfa-83d1-4a17-a100-d8474fdb723d/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/15667dfa-83d1-4a17-a100-d8474fdb723d/permission-settings"}}}}} ' headers: @@ -46,11 +46,11 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 24 Apr 2025 02:49:21 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:05 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Create_on_call_escalation_policy_returns_Created_response-1745462961@datadoghq.com","title":"user + string: '{"data":{"attributes":{"email":"Test-Create_on_call_escalation_policy_returns_Created_response-1745464625@datadoghq.com","title":"user title"},"type":"users"}}' headers: Accept: @@ -62,7 +62,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"ba36416f-20b6-11f0-80c3-2afe3706f727","attributes":{"name":null,"handle":"test-create_on_call_escalation_policy_returns_created_response-1745462961@datadoghq.com","created_at":"2025-04-24T02:49:22.874028+00:00","modified_at":"2025-04-24T02:49:22.874028+00:00","email":"test-create_on_call_escalation_policy_returns_created_response-1745462961@datadoghq.com","icon":"https://secure.gravatar.com/avatar/6a35b18888753aa49b46b0e245a5ce25?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"99c39f2a-20ba-11f0-892a-8ed3debb4e3c","attributes":{"name":null,"handle":"test-create_on_call_escalation_policy_returns_created_response-1745464625@datadoghq.com","created_at":"2025-04-24T03:17:06.422591+00:00","modified_at":"2025-04-24T03:17:06.422591+00:00","email":"test-create_on_call_escalation_policy_returns_created_response-1745464625@datadoghq.com","icon":"https://secure.gravatar.com/avatar/c1e19926cae1d8a175b99b6952c20aca?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -72,11 +72,11 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 24 Apr 2025 02:49:21 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:05 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"description":"Escalation Policy 1 description","name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745462961","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"ba36416f-20b6-11f0-80c3-2afe3706f727","type":"users"},{"id":"982c5000-f586-47ba-8a24-68cbfcb69dd8","type":"schedules"},{"id":"1a2f4aba-af9a-4b7c-bfc1-27147b24f69a","type":"teams"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"1a2f4aba-af9a-4b7c-bfc1-27147b24f69a","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"1a2f4aba-af9a-4b7c-bfc1-27147b24f69a","type":"teams"}]}},"type":"policies"}}' + string: '{"data":{"attributes":{"description":"Escalation Policy 1 description","name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745464625","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"99c39f2a-20ba-11f0-892a-8ed3debb4e3c","type":"users"},{"id":"2a44a887-add2-47f7-9535-92a2a8ebea79","type":"schedules"},{"id":"15667dfa-83d1-4a17-a100-d8474fdb723d","type":"teams"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"15667dfa-83d1-4a17-a100-d8474fdb723d","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"15667dfa-83d1-4a17-a100-d8474fdb723d","type":"teams"}]}},"type":"policies"}}' headers: Accept: - application/json @@ -87,22 +87,22 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"027666b2-8fa2-47a5-a9c6-9a7bed58f140","type":"policies","attributes":{"description":"Escalation - Policy 1 description","name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745462961","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"9d860392-4d2e-48d1-a5b4-09539bf5df12","type":"steps"},{"id":"75e94267-7fa6-4790-a81f-a6633f2e9c6e","type":"steps"}]},"teams":{"data":[{"id":"1a2f4aba-af9a-4b7c-bfc1-27147b24f69a","type":"teams"}]}}}}' + string: '{"data":{"id":"9269a3cc-3191-435d-b878-438cbe9f288e","type":"policies","attributes":{"description":"Escalation + Policy 1 description","name":"Test-Create_on_call_escalation_policy_returns_Created_response-1745464625","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"b292cc93-8f52-426d-88fb-0ac2b4a6fa10","type":"steps"},{"id":"aa60c048-510f-4e0d-bb1d-fc51606a66a1","type":"steps"}]},"teams":{"data":[{"id":"15667dfa-83d1-4a17-a100-d8474fdb723d","type":"teams"}]}}}}' headers: Content-Type: - application/vnd.api+json status: code: 201 message: Created -- recorded_at: Thu, 24 Apr 2025 02:49:21 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:05 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/027666b2-8fa2-47a5-a9c6-9a7bed58f140 + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/9269a3cc-3191-435d-b878-438cbe9f288e response: body: encoding: UTF-8 @@ -111,14 +111,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 24 Apr 2025 02:49:21 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:05 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/ba36416f-20b6-11f0-80c3-2afe3706f727 + uri: https://api.datadoghq.com/api/v2/users/99c39f2a-20ba-11f0-892a-8ed3debb4e3c response: body: encoding: UTF-8 @@ -127,14 +127,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 24 Apr 2025 02:49:21 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:05 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/team/1a2f4aba-af9a-4b7c-bfc1-27147b24f69a + uri: https://api.datadoghq.com/api/v2/team/15667dfa-83d1-4a17-a100-d8474fdb723d response: body: encoding: UTF-8 @@ -143,14 +143,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 24 Apr 2025 02:49:21 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:05 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/982c5000-f586-47ba-8a24-68cbfcb69dd8 + uri: https://api.datadoghq.com/api/v2/on-call/schedules/2a44a887-add2-47f7-9535-92a2a8ebea79 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/on-call/Delete-on-call-escalation-policy-returns-No-Content-response.frozen b/cassettes/features/v2/on-call/Delete-on-call-escalation-policy-returns-No-Content-response.frozen index 934268745e19..0f49465de0b4 100644 --- a/cassettes/features/v2/on-call/Delete-on-call-escalation-policy-returns-No-Content-response.frozen +++ b/cassettes/features/v2/on-call/Delete-on-call-escalation-policy-returns-No-Content-response.frozen @@ -1 +1 @@ -2025-04-24T02:49:32.262Z \ No newline at end of file +2025-04-24T03:17:07.960Z \ No newline at end of file diff --git a/cassettes/features/v2/on-call/Delete-on-call-escalation-policy-returns-No-Content-response.yml b/cassettes/features/v2/on-call/Delete-on-call-escalation-policy-returns-No-Content-response.yml index 6808712a2ac6..8108807215c2 100644 --- a/cassettes/features/v2/on-call/Delete-on-call-escalation-policy-returns-No-Content-response.yml +++ b/cassettes/features/v2/on-call/Delete-on-call-escalation-policy-returns-No-Content-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 24 Apr 2025 02:49:32 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:07 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972@datadoghq.com","title":"user + string: '{"data":{"attributes":{"email":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627@datadoghq.com","title":"user title"},"type":"users"}}' headers: Accept: @@ -15,7 +15,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"c02f8d1c-20b6-11f0-ab2c-227bd670db64","attributes":{"name":null,"handle":"test-delete_on_call_escalation_policy_returns_no_content_response-1745462972@datadoghq.com","created_at":"2025-04-24T02:49:32.896419+00:00","modified_at":"2025-04-24T02:49:32.896419+00:00","email":"test-delete_on_call_escalation_policy_returns_no_content_response-1745462972@datadoghq.com","icon":"https://secure.gravatar.com/avatar/c62c48dab244e5889d7e9acaf2f87894?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"9ac4c097-20ba-11f0-93bd-fe1e9003413a","attributes":{"name":null,"handle":"test-delete_on_call_escalation_policy_returns_no_content_response-1745464627@datadoghq.com","created_at":"2025-04-24T03:17:08.107723+00:00","modified_at":"2025-04-24T03:17:08.107723+00:00","email":"test-delete_on_call_escalation_policy_returns_no_content_response-1745464627@datadoghq.com","icon":"https://secure.gravatar.com/avatar/086fc14d750fb41c41edb93f40a83331?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -25,11 +25,11 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 24 Apr 2025 02:49:32 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:07 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"handle":"test-handle-7e60a3022d9f9ad9","name":"test-name-7e60a3022d9f9ad9"},"type":"team"}}' + string: '{"data":{"attributes":{"handle":"test-handle-25a086ee0229070e","name":"test-name-25a086ee0229070e"},"type":"team"}}' headers: Accept: - application/json @@ -40,7 +40,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"team","id":"2deba622-02f4-4c79-8120-0dc23ce700fc","attributes":{"name":"test-name-7e60a3022d9f9ad9","handle":"test-handle-7e60a3022d9f9ad9","summary":null,"description":null,"avatar":null,"banner":7,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T02:49:33.597906+00:00","modified_at":"2025-04-24T02:49:33.597915+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/2deba622-02f4-4c79-8120-0dc23ce700fc/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/2deba622-02f4-4c79-8120-0dc23ce700fc/permission-settings"}}}}} + string: '{"data":{"type":"team","id":"f4d93724-d4f7-462e-b1de-1abf73d182cb","attributes":{"name":"test-name-25a086ee0229070e","handle":"test-handle-25a086ee0229070e","summary":null,"description":null,"avatar":null,"banner":13,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T03:17:08.284107+00:00","modified_at":"2025-04-24T03:17:08.284117+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/f4d93724-d4f7-462e-b1de-1abf73d182cb/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/f4d93724-d4f7-462e-b1de-1abf73d182cb/permission-settings"}}}}} ' headers: @@ -49,12 +49,12 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 24 Apr 2025 02:49:32 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:07 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T02:49:32.262Z","end_date":"2025-05-04T02:49:32.262Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T02:49:32.262Z"}],"name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' + string: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T03:17:07.960Z","end_date":"2025-05-04T03:17:07.960Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T03:17:07.960Z"}],"name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' headers: Accept: - application/json @@ -65,18 +65,18 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"b521cc12-a23b-4fa2-b3d4-891484f6271c","type":"schedules","attributes":{"name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"a50d4ce3-8ae0-4bda-b9b3-05d37298a129","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"bfab7bf6-9cbb-4cb5-911c-1e8ad6483589","type":"schedules","attributes":{"name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"d65f680f-89e4-4643-baf8-d113f88b0efb","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: Content-Type: - application/vnd.api+json status: code: 201 message: Created -- recorded_at: Thu, 24 Apr 2025 02:49:32 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:07 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"description":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972","name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"2deba622-02f4-4c79-8120-0dc23ce700fc","type":"teams"},{"id":"b521cc12-a23b-4fa2-b3d4-891484f6271c","type":"schedules"},{"id":"c02f8d1c-20b6-11f0-ab2c-227bd670db64","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"2deba622-02f4-4c79-8120-0dc23ce700fc","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"2deba622-02f4-4c79-8120-0dc23ce700fc","type":"teams"}]}},"type":"policies"}}' + string: '{"data":{"attributes":{"description":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627","name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"f4d93724-d4f7-462e-b1de-1abf73d182cb","type":"teams"},{"id":"bfab7bf6-9cbb-4cb5-911c-1e8ad6483589","type":"schedules"},{"id":"9ac4c097-20ba-11f0-93bd-fe1e9003413a","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"f4d93724-d4f7-462e-b1de-1abf73d182cb","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"f4d93724-d4f7-462e-b1de-1abf73d182cb","type":"teams"}]}},"type":"policies"}}' headers: Accept: - application/json @@ -87,21 +87,21 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"44dd85a9-41bc-44f2-ac29-08ccbc4f1a21","type":"policies","attributes":{"description":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972","name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745462972","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"51a3a324-9905-4d72-9131-980f991160f6","type":"steps"},{"id":"170630ee-f429-4cf2-9e11-22d5b4ff7ab2","type":"steps"}]},"teams":{"data":[{"id":"2deba622-02f4-4c79-8120-0dc23ce700fc","type":"teams"}]}}}}' + string: '{"data":{"id":"b33d5cd2-3ba0-4201-925f-f5421f439786","type":"policies","attributes":{"description":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627","name":"Test-Delete_on_call_escalation_policy_returns_No_Content_response-1745464627","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"25aa772a-6f29-42a8-acf2-ba77cd1017fa","type":"steps"},{"id":"4428e9bb-f628-4f28-ae9a-e4390e2e3591","type":"steps"}]},"teams":{"data":[{"id":"f4d93724-d4f7-462e-b1de-1abf73d182cb","type":"teams"}]}}}}' headers: Content-Type: - application/vnd.api+json status: code: 201 message: Created -- recorded_at: Thu, 24 Apr 2025 02:49:32 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:07 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/44dd85a9-41bc-44f2-ac29-08ccbc4f1a21 + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/b33d5cd2-3ba0-4201-925f-f5421f439786 response: body: encoding: UTF-8 @@ -110,18 +110,18 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 24 Apr 2025 02:49:32 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:07 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/44dd85a9-41bc-44f2-ac29-08ccbc4f1a21 + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/b33d5cd2-3ba0-4201-925f-f5421f439786 response: body: encoding: UTF-8 - string: '{"errors":[{"title":"Generic Error","detail":"escalation_policy[44dd85a9-41bc-44f2-ac29-08ccbc4f1a21] + string: '{"errors":[{"title":"Generic Error","detail":"escalation_policy[b33d5cd2-3ba0-4201-925f-f5421f439786] not found"}]}' headers: Content-Type: @@ -129,14 +129,14 @@ http_interactions: status: code: 404 message: Not Found -- recorded_at: Thu, 24 Apr 2025 02:49:32 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:07 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/b521cc12-a23b-4fa2-b3d4-891484f6271c + uri: https://api.datadoghq.com/api/v2/on-call/schedules/bfab7bf6-9cbb-4cb5-911c-1e8ad6483589 response: body: encoding: UTF-8 @@ -145,14 +145,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 24 Apr 2025 02:49:32 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:07 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/team/2deba622-02f4-4c79-8120-0dc23ce700fc + uri: https://api.datadoghq.com/api/v2/team/f4d93724-d4f7-462e-b1de-1abf73d182cb response: body: encoding: UTF-8 @@ -161,14 +161,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 24 Apr 2025 02:49:32 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:07 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/c02f8d1c-20b6-11f0-ab2c-227bd670db64 + uri: https://api.datadoghq.com/api/v2/users/9ac4c097-20ba-11f0-93bd-fe1e9003413a response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/on-call/Update-on-call-escalation-policy-returns-OK-response.frozen b/cassettes/features/v2/on-call/Update-on-call-escalation-policy-returns-OK-response.frozen index 478929d577cd..fa920124cab1 100644 --- a/cassettes/features/v2/on-call/Update-on-call-escalation-policy-returns-OK-response.frozen +++ b/cassettes/features/v2/on-call/Update-on-call-escalation-policy-returns-OK-response.frozen @@ -1 +1 @@ -2025-04-24T02:49:49.725Z \ No newline at end of file +2025-04-24T03:17:12.320Z \ No newline at end of file diff --git a/cassettes/features/v2/on-call/Update-on-call-escalation-policy-returns-OK-response.yml b/cassettes/features/v2/on-call/Update-on-call-escalation-policy-returns-OK-response.yml index 6744e4b0404f..14ea10808266 100644 --- a/cassettes/features/v2/on-call/Update-on-call-escalation-policy-returns-OK-response.yml +++ b/cassettes/features/v2/on-call/Update-on-call-escalation-policy-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 24 Apr 2025 02:49:49 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:12 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989@datadoghq.com","title":"user + string: '{"data":{"attributes":{"email":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632@datadoghq.com","title":"user title"},"type":"users"}}' headers: Accept: @@ -15,7 +15,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"cab15683-20b6-11f0-892a-8ed3debb4e3c","attributes":{"name":null,"handle":"test-update_on_call_escalation_policy_returns_ok_response-1745462989@datadoghq.com","created_at":"2025-04-24T02:49:50.524204+00:00","modified_at":"2025-04-24T02:49:50.524204+00:00","email":"test-update_on_call_escalation_policy_returns_ok_response-1745462989@datadoghq.com","icon":"https://secure.gravatar.com/avatar/3db85ef85a418748eceea3fdcc017842?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"9d64aed1-20ba-11f0-9fba-9e18c50abaf7","attributes":{"name":null,"handle":"test-update_on_call_escalation_policy_returns_ok_response-1745464632@datadoghq.com","created_at":"2025-04-24T03:17:12.511290+00:00","modified_at":"2025-04-24T03:17:12.511290+00:00","email":"test-update_on_call_escalation_policy_returns_ok_response-1745464632@datadoghq.com","icon":"https://secure.gravatar.com/avatar/5eab1952bf2bb1dd7e013fe5aff37205?s=48&d=retro","title":"user title","verified":false,"service_account":false,"disabled":false,"allowed_login_methods":[],"status":"Pending"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -25,11 +25,11 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 24 Apr 2025 02:49:49 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:12 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"handle":"test-handle-aef238a64e0a3053","name":"test-name-aef238a64e0a3053"},"type":"team"}}' + string: '{"data":{"attributes":{"handle":"test-handle-f9de9970024d1bd3","name":"test-name-f9de9970024d1bd3"},"type":"team"}}' headers: Accept: - application/json @@ -40,7 +40,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"team","id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","attributes":{"name":"test-name-aef238a64e0a3053","handle":"test-handle-aef238a64e0a3053","summary":null,"description":null,"avatar":null,"banner":2,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T02:49:51.170217+00:00","modified_at":"2025-04-24T02:49:51.170244+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/8e19da47-5b16-4f4a-856e-19e8c207a8e8/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/8e19da47-5b16-4f4a-856e-19e8c207a8e8/permission-settings"}}}}} + string: '{"data":{"type":"team","id":"2265b16b-975f-494b-b6c7-d12774580f81","attributes":{"name":"test-name-f9de9970024d1bd3","handle":"test-handle-f9de9970024d1bd3","summary":null,"description":null,"avatar":null,"banner":10,"visible_modules":[],"hidden_modules":[],"created_at":"2025-04-24T03:17:12.716884+00:00","modified_at":"2025-04-24T03:17:12.716893+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/2265b16b-975f-494b-b6c7-d12774580f81/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/2265b16b-975f-494b-b6c7-d12774580f81/permission-settings"}}}}} ' headers: @@ -49,12 +49,12 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 24 Apr 2025 02:49:49 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:12 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T02:49:49.725Z","end_date":"2025-05-04T02:49:49.725Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer - 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T02:49:49.725Z"}],"name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' + string: '{"data":{"attributes":{"layers":[{"effective_date":"2025-04-14T03:17:12.320Z","end_date":"2025-05-04T03:17:12.320Z","interval":{"days":1},"members":[{"user":{"id":"890f29d4-0b7a-11f0-aeb2-760fcae4f596"}}],"name":"Layer + 1","restrictions":[{"end_day":"friday","end_time":"17:00:00","start_day":"monday","start_time":"09:00:00"}],"rotation_start":"2025-04-19T03:17:12.320Z"}],"name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}},"type":"schedules"}}' headers: Accept: - application/json @@ -65,18 +65,18 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"cbebffd6-9d48-4b03-b847-ee5f8a93d92a","type":"schedules","attributes":{"name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"9451cf82-df43-4c50-aa13-41db5b92aca6","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' + string: '{"data":{"id":"75777407-04a6-4136-add3-514e5dfb2a75","type":"schedules","attributes":{"name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","tags":["tag1","tag2"],"time_zone":"America/New_York"},"relationships":{"layers":{"data":[{"id":"9787ba9f-bdc0-4be1-80df-d51c12e5c0be","type":"layers"}]},"teams":{"data":[{"id":"65aea9d0-941c-4607-bf8a-14fc0dac2820","type":"teams"}]}}}}' headers: Content-Type: - application/vnd.api+json status: code: 201 message: Created -- recorded_at: Thu, 24 Apr 2025 02:49:49 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:12 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","type":"teams"},{"id":"cbebffd6-9d48-4b03-b847-ee5f8a93d92a","type":"schedules"},{"id":"cab15683-20b6-11f0-892a-8ed3debb4e3c","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","type":"teams"}]}},"type":"policies"}}' + string: '{"data":{"attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","resolve_page_on_policy_end":true,"retries":2,"steps":[{"assignment":"default","escalate_after_seconds":3600,"targets":[{"id":"2265b16b-975f-494b-b6c7-d12774580f81","type":"teams"},{"id":"75777407-04a6-4136-add3-514e5dfb2a75","type":"schedules"},{"id":"9d64aed1-20ba-11f0-9fba-9e18c50abaf7","type":"users"}]},{"assignment":"round-robin","escalate_after_seconds":3600,"targets":[{"id":"2265b16b-975f-494b-b6c7-d12774580f81","type":"teams"}]}]},"relationships":{"teams":{"data":[{"id":"2265b16b-975f-494b-b6c7-d12774580f81","type":"teams"}]}},"type":"policies"}}' headers: Accept: - application/json @@ -87,43 +87,43 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"id":"7f889d2e-2657-40a3-b27d-700ed017dbbf","type":"policies","attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"a3e73c74-1840-41ac-8855-466fd073b603","type":"steps"},{"id":"644fdcae-f647-4191-ae79-f99e5d2d21ea","type":"steps"}]},"teams":{"data":[{"id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","type":"teams"}]}}}}' + string: '{"data":{"id":"2c8f57da-076d-40ed-a23c-c96d147b95da","type":"policies","attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","resolve_page_on_policy_end":true,"retries":2},"relationships":{"steps":{"data":[{"id":"c085d5a2-a692-4576-9585-4196e6106796","type":"steps"},{"id":"d6e074c5-ef00-4bad-938b-3ef9a3f276d1","type":"steps"}]},"teams":{"data":[{"id":"2265b16b-975f-494b-b6c7-d12774580f81","type":"teams"}]}}}}' headers: Content-Type: - application/vnd.api+json status: code: 201 message: Created -- recorded_at: Thu, 24 Apr 2025 02:49:49 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:12 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989-updated","resolve_page_on_policy_end":false,"retries":0,"steps":[{"assignment":"default","escalate_after_seconds":3600,"id":"a3e73c74-1840-41ac-8855-466fd073b603","targets":[{"id":"cab15683-20b6-11f0-892a-8ed3debb4e3c","type":"users"}]}]},"id":"7f889d2e-2657-40a3-b27d-700ed017dbbf","relationships":{"teams":{"data":[{"id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","type":"teams"}]}},"type":"policies"}}' + string: '{"data":{"attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632-updated","resolve_page_on_policy_end":false,"retries":0,"steps":[{"assignment":"default","escalate_after_seconds":3600,"id":"c085d5a2-a692-4576-9585-4196e6106796","targets":[{"id":"9d64aed1-20ba-11f0-9fba-9e18c50abaf7","type":"users"}]}]},"id":"2c8f57da-076d-40ed-a23c-c96d147b95da","relationships":{"teams":{"data":[{"id":"2265b16b-975f-494b-b6c7-d12774580f81","type":"teams"}]}},"type":"policies"}}' headers: Accept: - application/json Content-Type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/7f889d2e-2657-40a3-b27d-700ed017dbbf + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/2c8f57da-076d-40ed-a23c-c96d147b95da response: body: encoding: UTF-8 - string: '{"data":{"id":"7f889d2e-2657-40a3-b27d-700ed017dbbf","type":"policies","attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745462989-updated","resolve_page_on_policy_end":false,"retries":0},"relationships":{"steps":{"data":[{"id":"a3e73c74-1840-41ac-8855-466fd073b603","type":"steps"}]},"teams":{"data":[{"id":"8e19da47-5b16-4f4a-856e-19e8c207a8e8","type":"teams"}]}}}}' + string: '{"data":{"id":"2c8f57da-076d-40ed-a23c-c96d147b95da","type":"policies","attributes":{"description":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632","name":"Test-Update_on_call_escalation_policy_returns_OK_response-1745464632-updated","resolve_page_on_policy_end":false,"retries":0},"relationships":{"steps":{"data":[{"id":"c085d5a2-a692-4576-9585-4196e6106796","type":"steps"}]},"teams":{"data":[{"id":"2265b16b-975f-494b-b6c7-d12774580f81","type":"teams"}]}}}}' headers: Content-Type: - application/vnd.api+json status: code: 200 message: OK -- recorded_at: Thu, 24 Apr 2025 02:49:49 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:12 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/7f889d2e-2657-40a3-b27d-700ed017dbbf + uri: https://api.datadoghq.com/api/v2/on-call/escalation-policies/2c8f57da-076d-40ed-a23c-c96d147b95da response: body: encoding: UTF-8 @@ -132,14 +132,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 24 Apr 2025 02:49:49 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:12 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/on-call/schedules/cbebffd6-9d48-4b03-b847-ee5f8a93d92a + uri: https://api.datadoghq.com/api/v2/on-call/schedules/75777407-04a6-4136-add3-514e5dfb2a75 response: body: encoding: UTF-8 @@ -148,14 +148,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 24 Apr 2025 02:49:49 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:12 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/team/8e19da47-5b16-4f4a-856e-19e8c207a8e8 + uri: https://api.datadoghq.com/api/v2/team/2265b16b-975f-494b-b6c7-d12774580f81 response: body: encoding: UTF-8 @@ -164,14 +164,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 24 Apr 2025 02:49:49 GMT +- recorded_at: Thu, 24 Apr 2025 03:17:12 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/cab15683-20b6-11f0-892a-8ed3debb4e3c + uri: https://api.datadoghq.com/api/v2/users/9d64aed1-20ba-11f0-9fba-9e18c50abaf7 response: body: encoding: UTF-8 diff --git a/examples/v2/network-device-monitoring/ListDevices_2712868412.rb b/examples/v2/network-device-monitoring/ListDevices_2712868412.rb new file mode 100644 index 000000000000..0314db145d32 --- /dev/null +++ b/examples/v2/network-device-monitoring/ListDevices_2712868412.rb @@ -0,0 +1,5 @@ +# Get the list of devices returns "OK" response with pagination + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::NetworkDeviceMonitoringAPI.new +api_instance.list_devices_with_pagination() { |item| puts item } diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 728b23f0b622..302379f77097 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2013,8 +2013,8 @@ "body" => "MonitorConfigPolicyEditRequest", }, "v2.ListDevices" => { - "page_number" => "Integer", "page_size" => "Integer", + "page_number" => "Integer", "sort" => "String", "filter_tag" => "String", }, diff --git a/features/v2/network_device_monitoring.feature b/features/v2/network_device_monitoring.feature index 50be39165309..f6f7a78f257c 100644 --- a/features/v2/network_device_monitoring.feature +++ b/features/v2/network_device_monitoring.feature @@ -75,6 +75,12 @@ Feature: Network Device Monitoring And the response "data[0].attributes.interface_statuses.down" is equal to 13 And the response "meta.page.total_filtered_count" is equal to 1 + @generated @skip @team:DataDog/network-device-monitoring @with-pagination + Scenario: Get the list of devices returns "OK" response with pagination + Given new "ListDevices" request + When the request with pagination is sent + Then the response status is 200 OK + @replay-only @team:DataDog/network-device-monitoring Scenario: Get the list of interfaces of the device returns "OK" response Given new "GetInterfaces" request diff --git a/lib/datadog_api_client/v2/api/network_device_monitoring_api.rb b/lib/datadog_api_client/v2/api/network_device_monitoring_api.rb index 8169687eee57..d75a30653d6d 100644 --- a/lib/datadog_api_client/v2/api/network_device_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/network_device_monitoring_api.rb @@ -169,8 +169,8 @@ def list_devices(opts = {}) # Get the list of devices. # # @param opts [Hash] the optional parameters - # @option opts [Integer] :page_number The page number to fetch. - # @option opts [Integer] :page_size The number of devices to return per page. + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. # @option opts [String] :sort The field to sort the devices by. # @option opts [String] :filter_tag Filter devices by tag. # @return [Array<(ListDevicesResponse, Integer, Hash)>] ListDevicesResponse data, response status code and response headers @@ -184,8 +184,8 @@ def list_devices_with_http_info(opts = {}) # query parameters query_params = opts[:query_params] || {} - query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'filter[tag]'] = opts[:'filter_tag'] if !opts[:'filter_tag'].nil? @@ -224,6 +224,28 @@ def list_devices_with_http_info(opts = {}) return data, status_code, headers end + # Get the list of devices. + # + # Provide a paginated version of {#list_devices}, returning all items. + # + # To use it you need to use a block: list_devices_with_pagination { |item| p item } + # + # @yield [DevicesListData] Paginated items + def list_devices_with_pagination(opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) + @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0) + while true do + response = list_devices(opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1) + end + end + # Get the list of tags for a device. # # @see #list_device_user_tags_with_http_info