diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_api_create_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_api_create_with_all_optional_params.yaml new file mode 100644 index 00000000000..690af4a0365 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_api_create_with_all_optional_params.yaml @@ -0,0 +1,67 @@ +interactions: +- request: + body: '{"properties": {"contacts": [{"email": "contact@example.com", "name": "test", + "url": "example.com"}], "customProperties": {"clitest000003": true}, "description": + "API description", "externalDocumentation": [{"title": "onboarding docs", "url": + "example.com"}], "kind": "rest", "license": {"url": "example.com"}, "summary": + "summary", "title": "test api"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api create + Connection: + - keep-alive + Content-Length: + - '354' + Content-Type: + - application/json + ParameterSetName: + - -g -s --api-id --title --type --contacts --custom-properties --description + --external-documentation --license --summary + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/cli000004?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"test + api","summary":"summary","description":"API description","kind":"rest","license":{"url":"example.com"},"externalDocumentation":[{"title":"onboarding + docs","url":"example.com"}],"contacts":[{"name":"test","url":"example.com","email":"contact@example.com"}],"customProperties":{"clitest000003":true}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/cli000004","name":"cli000004","systemData":{"createdAt":"2024-05-16T08:16:34.3016442Z","lastModifiedAt":"2024-05-16T08:16:34.3016324Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '680' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 16 May 2024 08:16:33 GMT + etag: + - 2900e52e-0000-0100-0000-6645c0e20000 + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: ADF8917A140242AAA8FADA28D262A894 Ref B: MAA201060514009 Ref C: 2024-05-16T08:16:32Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_api_delete.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_api_delete.yaml index 8006fa2b6e7..118e60106ff 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_api_delete.yaml +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_api_delete.yaml @@ -27,7 +27,7 @@ interactions: cache-control: - no-cache date: - - Tue, 07 May 2024 11:32:34 GMT + - Fri, 17 May 2024 03:17:25 GMT expires: - '-1' pragma: @@ -41,10 +41,60 @@ interactions: x-ms-ratelimit-remaining-subscription-deletes: - '14999' x-msedge-ref: - - 'Ref A: DB255A79DE584A6E96C87DCCEE911204 Ref B: MAA201060515039 Ref C: 2024-05-07T11:32:33Z' + - 'Ref A: E19B9F85D64543C8A6D0A898B3BF8D2B Ref B: MAA201060513021 Ref C: 2024-05-17T03:17:24Z' x-powered-by: - ASP.NET status: code: 204 message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api show + Connection: + - keep-alive + ParameterSetName: + - -g -s --api-id + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003?api-version=2024-03-01 + response: + body: + string: '{"code":"404"}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '14' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 May 2024 03:17:27 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: AF791DC5CCB94CA4BF9BA275AD679992 Ref B: MAA201060515017 Ref C: 2024-05-17T03:17:26Z' + x-powered-by: + - ASP.NET + status: + code: 404 + message: Not Found version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_api_list_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_api_list_with_all_optional_params.yaml new file mode 100644 index 00000000000..fa454728199 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_api_list_with_all_optional_params.yaml @@ -0,0 +1,53 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api list + Connection: + - keep-alive + ParameterSetName: + - -g -s --filter + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis?$filter=name%20eq%20%27clitest000003%27&api-version=2024-03-01 + response: + body: + string: '{"value":[{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"Echo + API","kind":"rest","externalDocumentation":[],"contacts":[],"customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003","name":"clitest000003","systemData":{"createdAt":"2024-05-16T08:16:31.1197126Z","lastModifiedAt":"2024-05-16T08:16:31.1197111Z"}}]}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '484' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 16 May 2024 08:16:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 1E0CF70F2DD14DD9A3D655D15D3480CD Ref B: MAA201060516023 Ref C: 2024-05-16T08:16:36Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_api_update_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_api_update_with_all_optional_params.yaml new file mode 100644 index 00000000000..c75120af483 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_api_update_with_all_optional_params.yaml @@ -0,0 +1,121 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api update + Connection: + - keep-alive + ParameterSetName: + - -g -s --api-id --title --type --contacts --custom-properties --description + --external-documentation --license --summary + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"Echo + API","kind":"rest","externalDocumentation":[],"contacts":[],"customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003","name":"clitest000003","systemData":{"createdAt":"2024-05-16T08:16:30.9912252Z","lastModifiedAt":"2024-05-16T08:16:30.9912236Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '472' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 16 May 2024 08:16:36 GMT + etag: + - 2900c52e-0000-0100-0000-6645c0de0000 + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 1F3926C9BD3A4C29AE0AFA8F9A518AE2 Ref B: MAA201060514021 Ref C: 2024-05-16T08:16:36Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"contacts": [{"email": "contact@example.com", "name": "test", + "url": "example.com"}], "customProperties": {"clitest000004": true}, "description": + "API description", "externalDocumentation": [{"title": "onboarding docs", "url": + "example.com"}], "kind": "rest", "license": {"url": "example.com"}, "summary": + "summary", "title": "test api 2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api update + Connection: + - keep-alive + Content-Length: + - '356' + Content-Type: + - application/json + ParameterSetName: + - -g -s --api-id --title --type --contacts --custom-properties --description + --external-documentation --license --summary + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"test + api 2","summary":"summary","description":"API description","kind":"rest","license":{"url":"example.com"},"externalDocumentation":[{"title":"onboarding + docs","url":"example.com"}],"contacts":[{"name":"test","url":"example.com","email":"contact@example.com"}],"customProperties":{"clitest000004":true}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003","name":"clitest000003","systemData":{"lastModifiedAt":"2024-05-16T08:16:39.058988Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '646' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 16 May 2024 08:16:38 GMT + etag: + - 2900002f-0000-0100-0000-6645c0e70000 + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: 17A1767E072F49859F7582F5B02ABD27 Ref B: MAA201060514021 Ref C: 2024-05-16T08:16:37Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_create_service_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_create_service_with_all_optional_params.yaml new file mode 100644 index 00000000000..f84e419ffff --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_create_service_with_all_optional_params.yaml @@ -0,0 +1,59 @@ +interactions: +- request: + body: '{"identity": {"type": "SystemAssigned"}, "location": "westeurope", "tags": + {"test": "value"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic service create + Connection: + - keep-alive + Content-Length: + - '93' + Content-Type: + - application/json + ParameterSetName: + - -g --name --location --tags --identity + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/cli000002?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services","location":"westeurope","identity":{"type":"SystemAssigned","principalId":"c9869f92-bc42-4001-84cf-0d11469f2508","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"},"sku":{"name":"Free"},"properties":{},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/cli000002","name":"cli000002","tags":{"test":"value"},"systemData":{"createdAt":"2024-05-15T07:47:48.5289093Z","lastModifiedAt":"2024-05-15T07:47:48.528896Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '524' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 15 May 2024 07:47:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: 7F87441C541D4B62AA0D2BCE2176371C Ref B: MAA201060516023 Ref C: 2024-05-15T07:47:44Z' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_create_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_create_with_all_optional_params.yaml new file mode 100644 index 00000000000..567debf96a1 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_create_with_all_optional_params.yaml @@ -0,0 +1,61 @@ +interactions: +- request: + body: '{"properties": {"description": "test description", "title": "OpenAPI"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api definition create + Connection: + - keep-alive + Content-Length: + - '71' + Content-Type: + - application/json + ParameterSetName: + - -g -s --api-id --version-id --definition-id --title --description + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/cli000005?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions/definitions","properties":{"title":"OpenAPI","description":"test + description"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/cli000005","name":"cli000005","systemData":{"createdAt":"2024-05-16T08:37:20.1845653Z","lastModifiedAt":"2024-05-16T08:37:20.1845647Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '489' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 16 May 2024 08:37:19 GMT + etag: + - 42002269-0000-0100-0000-6645c5c00000 + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: D1CE718BFBDC43E5AFBD0CCBBE20D9A6 Ref B: MAA201060514023 Ref C: 2024-05-16T08:37:18Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_delete.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_delete.yaml index 4224bd3330b..539197ca236 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_delete.yaml +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_delete.yaml @@ -29,7 +29,7 @@ interactions: content-length: - '0' date: - - Tue, 07 May 2024 12:33:17 GMT + - Fri, 17 May 2024 03:18:34 GMT expires: - '-1' pragma: @@ -41,12 +41,62 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' x-msedge-ref: - - 'Ref A: 375D48828C5C438C8C025235B5D631D0 Ref B: MAA201060515017 Ref C: 2024-05-07T12:33:16Z' + - 'Ref A: 4BCCF1879F33461394491BD332646B13 Ref B: MAA201060514039 Ref C: 2024-05-17T03:18:34Z' x-powered-by: - ASP.NET status: code: 200 message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api definition show + Connection: + - keep-alive + ParameterSetName: + - -g -s --api-id --version-id --definition-id + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/clitest000005?api-version=2024-03-01 + response: + body: + string: '{"code":"404"}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '14' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 May 2024 03:18:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: F52D3686703249E59A8577C5C9700D57 Ref B: MAA201060514017 Ref C: 2024-05-17T03:18:36Z' + x-powered-by: + - ASP.NET + status: + code: 404 + message: Not Found version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_import_from_file.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_import_from_file.yaml new file mode 100644 index 00000000000..86df96b3172 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_import_from_file.yaml @@ -0,0 +1,947 @@ +interactions: +- request: + body: '{"format": "inline", "specification": {"name": "openapi", "version": "3.0.0"}, + "value": "{\r\n \"openapi\": \"3.0.2\",\r\n \"info\": {\r\n \"title\": + \"Swagger Petstore - OpenAPI 3.0\",\r\n \"description\": \"This is a + sample Pet Store Server based on the OpenAPI 3.0 specification. You can find + out more about\\nSwagger at [http://swagger.io](http://swagger.io). In the third + iteration of the pet store, we''ve switched to the design first approach!\\nYou + can now help us improve the API whether it''s by making changes to the definition + itself or to the code.\\nThat way, with time, we can improve the API in general, + and expose some of the new features in OAS3.\\n\\nSome useful links:\\n- [The + Pet Store repository](https://github.com/swagger-api/swagger-petstore)\\n- [The + source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)\",\r\n \"termsOfService\": + \"http://swagger.io/terms/\",\r\n \"contact\": {\r\n \"email\": + \"apiteam@swagger.io\"\r\n },\r\n \"license\": {\r\n \"name\": + \"Apache 2.0\",\r\n \"url\": \"http://www.apache.org/licenses/LICENSE-2.0.html\"\r\n },\r\n \"version\": + \"1.0.19\"\r\n },\r\n \"externalDocs\": {\r\n \"description\": + \"Find out more about Swagger\",\r\n \"url\": \"http://swagger.io\"\r\n },\r\n \"servers\": + [\r\n {\r\n \"url\": \"/api/v3\"\r\n }\r\n ],\r\n \"tags\": + [\r\n {\r\n \"name\": \"pet\",\r\n \"description\": + \"Everything about your Pets\",\r\n \"externalDocs\": {\r\n \"description\": + \"Find out more\",\r\n \"url\": \"http://swagger.io\"\r\n }\r\n },\r\n {\r\n \"name\": + \"store\",\r\n \"description\": \"Access to Petstore orders\",\r\n \"externalDocs\": + {\r\n \"description\": \"Find out more about our store\",\r\n \"url\": + \"http://swagger.io\"\r\n }\r\n },\r\n {\r\n \"name\": + \"user\",\r\n \"description\": \"Operations about user\"\r\n }\r\n ],\r\n \"paths\": + {\r\n \"/pet\": {\r\n \"put\": {\r\n \"tags\": + [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Update an existing pet\",\r\n \"description\": \"Update an + existing pet by Id\",\r\n \"operationId\": \"updatePet\",\r\n \"requestBody\": + {\r\n \"description\": \"Update an existent pet in the store\",\r\n \"content\": + {\r\n \"application/json\": {\r\n \"schema\": + {\r\n \"$ref\": \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/x-www-form-urlencoded\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n },\r\n \"required\": + true\r\n },\r\n \"responses\": {\r\n \"200\": + {\r\n \"description\": \"Successful operation\",\r\n \"content\": + {\r\n \"application/xml\": {\r\n \"schema\": + {\r\n \"$ref\": \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid ID supplied\"\r\n },\r\n \"404\": + {\r\n \"description\": \"Pet not found\"\r\n },\r\n \"405\": + {\r\n \"description\": \"Validation exception\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n },\r\n \"post\": + {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Add a new pet to the store\",\r\n \"description\": \"Add a + new pet to the store\",\r\n \"operationId\": \"addPet\",\r\n \"requestBody\": + {\r\n \"description\": \"Create a new pet in the store\",\r\n \"content\": + {\r\n \"application/json\": {\r\n \"schema\": + {\r\n \"$ref\": \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/x-www-form-urlencoded\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n },\r\n \"required\": + true\r\n },\r\n \"responses\": {\r\n \"200\": + {\r\n \"description\": \"Successful operation\",\r\n \"content\": + {\r\n \"application/xml\": {\r\n \"schema\": + {\r\n \"$ref\": \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n }\r\n },\r\n \"405\": + {\r\n \"description\": \"Invalid input\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n }\r\n },\r\n \"/pet/findByStatus\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Finds Pets by status\",\r\n \"description\": \"Multiple status + values can be provided with comma separated strings\",\r\n \"operationId\": + \"findPetsByStatus\",\r\n \"parameters\": [\r\n {\r\n \"name\": + \"status\",\r\n \"in\": \"query\",\r\n \"description\": + \"Status values that need to be considered for filter\",\r\n \"required\": + false,\r\n \"explode\": true,\r\n \"schema\": + {\r\n \"type\": \"string\",\r\n \"default\": + \"available\",\r\n \"enum\": [\r\n \"available\",\r\n \"pending\",\r\n \"sold\"\r\n ]\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"type\": + \"array\",\r\n \"items\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"type\": + \"array\",\r\n \"items\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid status value\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n }\r\n },\r\n \"/pet/findByTags\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Finds Pets by tags\",\r\n \"description\": \"Multiple tags + can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.\",\r\n \"operationId\": + \"findPetsByTags\",\r\n \"parameters\": [\r\n {\r\n \"name\": + \"tags\",\r\n \"in\": \"query\",\r\n \"description\": + \"Tags to filter by\",\r\n \"required\": false,\r\n \"explode\": + true,\r\n \"schema\": {\r\n \"type\": + \"array\",\r\n \"items\": {\r\n \"type\": + \"string\"\r\n }\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"type\": + \"array\",\r\n \"items\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"type\": + \"array\",\r\n \"items\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid tag value\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n }\r\n },\r\n \"/pet/{petId}\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Find pet by ID\",\r\n \"description\": \"Returns a single pet\",\r\n \"operationId\": + \"getPetById\",\r\n \"parameters\": [\r\n {\r\n \"name\": + \"petId\",\r\n \"in\": \"path\",\r\n \"description\": + \"ID of pet to return\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid ID supplied\"\r\n },\r\n \"404\": + {\r\n \"description\": \"Pet not found\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"api_key\": []\r\n },\r\n {\r\n \"petstore_auth\": + [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n },\r\n \"post\": + {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Updates a pet in the store with form data\",\r\n \"description\": + \"\",\r\n \"operationId\": \"updatePetWithForm\",\r\n \"parameters\": + [\r\n {\r\n \"name\": \"petId\",\r\n \"in\": + \"path\",\r\n \"description\": \"ID of pet that needs + to be updated\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\"\r\n }\r\n },\r\n {\r\n \"name\": + \"name\",\r\n \"in\": \"query\",\r\n \"description\": + \"Name of pet that needs to be updated\",\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n {\r\n \"name\": + \"status\",\r\n \"in\": \"query\",\r\n \"description\": + \"Status of pet that needs to be updated\",\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"405\": {\r\n \"description\": + \"Invalid input\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n },\r\n \"delete\": + {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Deletes a pet\",\r\n \"description\": \"\",\r\n \"operationId\": + \"deletePet\",\r\n \"parameters\": [\r\n {\r\n \"name\": + \"api_key\",\r\n \"in\": \"header\",\r\n \"description\": + \"\",\r\n \"required\": false,\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n {\r\n \"name\": + \"petId\",\r\n \"in\": \"path\",\r\n \"description\": + \"Pet id to delete\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"400\": {\r\n \"description\": + \"Invalid pet value\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n }\r\n },\r\n \"/pet/{petId}/uploadImage\": + {\r\n \"post\": {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"uploads an image\",\r\n \"description\": \"\",\r\n \"operationId\": + \"uploadFile\",\r\n \"parameters\": [\r\n {\r\n \"name\": + \"petId\",\r\n \"in\": \"path\",\r\n \"description\": + \"ID of pet to update\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\"\r\n }\r\n },\r\n {\r\n \"name\": + \"additionalMetadata\",\r\n \"in\": \"query\",\r\n \"description\": + \"Additional Metadata\",\r\n \"required\": false,\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n }\r\n ],\r\n \"requestBody\": + {\r\n \"content\": {\r\n \"application/octet-stream\": + {\r\n \"schema\": {\r\n \"type\": + \"string\",\r\n \"format\": \"binary\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/ApiResponse\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n }\r\n },\r\n \"/store/inventory\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"store\"\r\n ],\r\n \"summary\": + \"Returns pet inventories by status\",\r\n \"description\": \"Returns + a map of status codes to quantities\",\r\n \"operationId\": \"getInventory\",\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"type\": + \"object\",\r\n \"additionalProperties\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int32\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"api_key\": []\r\n }\r\n ]\r\n }\r\n },\r\n \"/store/order\": + {\r\n \"post\": {\r\n \"tags\": [\r\n \"store\"\r\n ],\r\n \"summary\": + \"Place an order for a pet\",\r\n \"description\": \"Place a + new order in the store\",\r\n \"operationId\": \"placeOrder\",\r\n \"requestBody\": + {\r\n \"content\": {\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Order\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Order\"\r\n }\r\n },\r\n \"application/x-www-form-urlencoded\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Order\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Order\"\r\n }\r\n }\r\n }\r\n },\r\n \"405\": + {\r\n \"description\": \"Invalid input\"\r\n }\r\n }\r\n }\r\n },\r\n \"/store/order/{orderId}\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"store\"\r\n ],\r\n \"summary\": + \"Find purchase order by ID\",\r\n \"description\": \"For valid + response try integer IDs with value <= 5 or > 10. Other values will generate + exceptions.\",\r\n \"operationId\": \"getOrderById\",\r\n \"parameters\": + [\r\n {\r\n \"name\": \"orderId\",\r\n \"in\": + \"path\",\r\n \"description\": \"ID of order that needs + to be fetched\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Order\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Order\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid ID supplied\"\r\n },\r\n \"404\": + {\r\n \"description\": \"Order not found\"\r\n }\r\n }\r\n },\r\n \"delete\": + {\r\n \"tags\": [\r\n \"store\"\r\n ],\r\n \"summary\": + \"Delete purchase order by ID\",\r\n \"description\": \"For valid + response try integer IDs with value < 1000. Anything above 1000 or nonintegers + will generate API errors\",\r\n \"operationId\": \"deleteOrder\",\r\n \"parameters\": + [\r\n {\r\n \"name\": \"orderId\",\r\n \"in\": + \"path\",\r\n \"description\": \"ID of the order that + needs to be deleted\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"400\": {\r\n \"description\": + \"Invalid ID supplied\"\r\n },\r\n \"404\": + {\r\n \"description\": \"Order not found\"\r\n }\r\n }\r\n }\r\n },\r\n \"/user\": + {\r\n \"post\": {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Create user\",\r\n \"description\": \"This can only be done + by the logged in user.\",\r\n \"operationId\": \"createUser\",\r\n \"requestBody\": + {\r\n \"description\": \"Created user object\",\r\n \"content\": + {\r\n \"application/json\": {\r\n \"schema\": + {\r\n \"$ref\": \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/x-www-form-urlencoded\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": + {\r\n \"default\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/user/createWithList\": + {\r\n \"post\": {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Creates list of users with given input array\",\r\n \"description\": + \"Creates list of users with given input array\",\r\n \"operationId\": + \"createUsersWithListInput\",\r\n \"requestBody\": {\r\n \"content\": + {\r\n \"application/json\": {\r\n \"schema\": + {\r\n \"type\": \"array\",\r\n \"items\": + {\r\n \"$ref\": \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"Successful operation\",\r\n \"content\": {\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n },\r\n \"default\": + {\r\n \"description\": \"successful operation\"\r\n }\r\n }\r\n }\r\n },\r\n \"/user/login\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Logs user into the system\",\r\n \"description\": \"\",\r\n \"operationId\": + \"loginUser\",\r\n \"parameters\": [\r\n {\r\n \"name\": + \"username\",\r\n \"in\": \"query\",\r\n \"description\": + \"The user name for login\",\r\n \"required\": false,\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n {\r\n \"name\": + \"password\",\r\n \"in\": \"query\",\r\n \"description\": + \"The password for login in clear text\",\r\n \"required\": + false,\r\n \"schema\": {\r\n \"type\": + \"string\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"headers\": {\r\n \"X-Rate-Limit\": + {\r\n \"description\": \"calls per hour allowed + by the user\",\r\n \"schema\": {\r\n \"type\": + \"integer\",\r\n \"format\": \"int32\"\r\n }\r\n },\r\n \"X-Expires-After\": + {\r\n \"description\": \"date in UTC when token + expires\",\r\n \"schema\": {\r\n \"type\": + \"string\",\r\n \"format\": \"date-time\"\r\n }\r\n }\r\n },\r\n \"content\": + {\r\n \"application/xml\": {\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"type\": + \"string\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid username/password supplied\"\r\n }\r\n }\r\n }\r\n },\r\n \"/user/logout\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Logs out current logged in user session\",\r\n \"description\": + \"\",\r\n \"operationId\": \"logoutUser\",\r\n \"parameters\": + [],\r\n \"responses\": {\r\n \"default\": + {\r\n \"description\": \"successful operation\"\r\n }\r\n }\r\n }\r\n },\r\n \"/user/{username}\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Get user by user name\",\r\n \"description\": \"\",\r\n \"operationId\": + \"getUserByName\",\r\n \"parameters\": [\r\n {\r\n \"name\": + \"username\",\r\n \"in\": \"path\",\r\n \"description\": + \"The name that needs to be fetched. Use user1 for testing. \",\r\n \"required\": + true,\r\n \"schema\": {\r\n \"type\": + \"string\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid username supplied\"\r\n },\r\n \"404\": + {\r\n \"description\": \"User not found\"\r\n }\r\n }\r\n },\r\n \"put\": + {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Update user\",\r\n \"description\": \"This can only be done + by the logged in user.\",\r\n \"operationId\": \"updateUser\",\r\n \"parameters\": + [\r\n {\r\n \"name\": \"username\",\r\n \"in\": + \"path\",\r\n \"description\": \"name that needs to be + updated\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n }\r\n ],\r\n \"requestBody\": + {\r\n \"description\": \"Update an existent user in the store\",\r\n \"content\": + {\r\n \"application/json\": {\r\n \"schema\": + {\r\n \"$ref\": \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/x-www-form-urlencoded\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": + {\r\n \"default\": {\r\n \"description\": + \"successful operation\"\r\n }\r\n }\r\n },\r\n \"delete\": + {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Delete user\",\r\n \"description\": \"This can only be done + by the logged in user.\",\r\n \"operationId\": \"deleteUser\",\r\n \"parameters\": + [\r\n {\r\n \"name\": \"username\",\r\n \"in\": + \"path\",\r\n \"description\": \"The name that needs + to be deleted\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"400\": {\r\n \"description\": + \"Invalid username supplied\"\r\n },\r\n \"404\": + {\r\n \"description\": \"User not found\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"components\": + {\r\n \"schemas\": {\r\n \"Order\": {\r\n \"type\": + \"object\",\r\n \"properties\": {\r\n \"id\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\",\r\n \"example\": 10\r\n },\r\n \"petId\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\",\r\n \"example\": 198772\r\n },\r\n \"quantity\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int32\",\r\n \"example\": 7\r\n },\r\n \"shipDate\": + {\r\n \"type\": \"string\",\r\n \"format\": + \"date-time\"\r\n },\r\n \"status\": {\r\n \"type\": + \"string\",\r\n \"description\": \"Order Status\",\r\n \"example\": + \"approved\",\r\n \"enum\": [\r\n \"placed\",\r\n \"approved\",\r\n \"delivered\"\r\n ]\r\n },\r\n \"complete\": + {\r\n \"type\": \"boolean\"\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"order\"\r\n }\r\n },\r\n \"Customer\": + {\r\n \"type\": \"object\",\r\n \"properties\": + {\r\n \"id\": {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\",\r\n \"example\": 100000\r\n },\r\n \"username\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"fehguy\"\r\n },\r\n \"address\": {\r\n \"type\": + \"array\",\r\n \"xml\": {\r\n \"name\": + \"addresses\",\r\n \"wrapped\": true\r\n },\r\n \"items\": + {\r\n \"$ref\": \"#/components/schemas/Address\"\r\n }\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"customer\"\r\n }\r\n },\r\n \"Address\": + {\r\n \"type\": \"object\",\r\n \"properties\": + {\r\n \"street\": {\r\n \"type\": + \"string\",\r\n \"example\": \"437 Lytton\"\r\n },\r\n \"city\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"Palo Alto\"\r\n },\r\n \"state\": {\r\n \"type\": + \"string\",\r\n \"example\": \"CA\"\r\n },\r\n \"zip\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"94301\"\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"address\"\r\n }\r\n },\r\n \"Category\": + {\r\n \"type\": \"object\",\r\n \"properties\": + {\r\n \"id\": {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\",\r\n \"example\": 1\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"Dogs\"\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"category\"\r\n }\r\n },\r\n \"User\": + {\r\n \"type\": \"object\",\r\n \"properties\": + {\r\n \"id\": {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\",\r\n \"example\": 10\r\n },\r\n \"username\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"theUser\"\r\n },\r\n \"firstName\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"John\"\r\n },\r\n \"lastName\": {\r\n \"type\": + \"string\",\r\n \"example\": \"James\"\r\n },\r\n \"email\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"john@email.com\"\r\n },\r\n \"password\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"12345\"\r\n },\r\n \"phone\": {\r\n \"type\": + \"string\",\r\n \"example\": \"12345\"\r\n },\r\n \"userStatus\": + {\r\n \"type\": \"integer\",\r\n \"description\": + \"User Status\",\r\n \"format\": \"int32\",\r\n \"example\": + 1\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"user\"\r\n }\r\n },\r\n \"Tag\": + {\r\n \"type\": \"object\",\r\n \"properties\": + {\r\n \"id\": {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\"\r\n },\r\n \"name\": {\r\n \"type\": + \"string\"\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"tag\"\r\n }\r\n },\r\n \"Pet\": + {\r\n \"required\": [\r\n \"name\",\r\n \"photoUrls\"\r\n ],\r\n \"type\": + \"object\",\r\n \"properties\": {\r\n \"id\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\",\r\n \"example\": 10\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"doggie\"\r\n },\r\n \"category\": {\r\n \"$ref\": + \"#/components/schemas/Category\"\r\n },\r\n \"photoUrls\": + {\r\n \"type\": \"array\",\r\n \"xml\": + {\r\n \"wrapped\": true\r\n },\r\n \"items\": + {\r\n \"type\": \"string\",\r\n \"xml\": + {\r\n \"name\": \"photoUrl\"\r\n }\r\n }\r\n },\r\n \"tags\": + {\r\n \"type\": \"array\",\r\n \"xml\": + {\r\n \"wrapped\": true\r\n },\r\n \"items\": + {\r\n \"$ref\": \"#/components/schemas/Tag\"\r\n }\r\n },\r\n \"status\": + {\r\n \"type\": \"string\",\r\n \"description\": + \"pet status in the store\",\r\n \"enum\": [\r\n \"available\",\r\n \"pending\",\r\n \"sold\"\r\n ]\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"pet\"\r\n }\r\n },\r\n \"ApiResponse\": + {\r\n \"type\": \"object\",\r\n \"properties\": + {\r\n \"code\": {\r\n \"type\": \"integer\",\r\n \"format\": + \"int32\"\r\n },\r\n \"type\": {\r\n \"type\": + \"string\"\r\n },\r\n \"message\": {\r\n \"type\": + \"string\"\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"##default\"\r\n }\r\n }\r\n },\r\n \"requestBodies\": + {\r\n \"Pet\": {\r\n \"description\": \"Pet object + that needs to be added to the store\",\r\n \"content\": {\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n }\r\n },\r\n \"UserArray\": + {\r\n \"description\": \"List of user object\",\r\n \"content\": + {\r\n \"application/json\": {\r\n \"schema\": + {\r\n \"type\": \"array\",\r\n \"items\": + {\r\n \"$ref\": \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"securitySchemes\": + {\r\n \"petstore_auth\": {\r\n \"type\": \"oauth2\",\r\n \"flows\": + {\r\n \"implicit\": {\r\n \"authorizationUrl\": + \"https://petstore3.swagger.io/oauth/authorize\",\r\n \"scopes\": + {\r\n \"write:pets\": \"modify pets in your account\",\r\n \"read:pets\": + \"read your pets\"\r\n }\r\n }\r\n }\r\n },\r\n \"api_key\": + {\r\n \"type\": \"apiKey\",\r\n \"name\": \"api_key\",\r\n \"in\": + \"header\"\r\n }\r\n }\r\n }\r\n}"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api definition import-specification + Connection: + - keep-alive + Content-Length: + - '50270' + Content-Type: + - application/json + ParameterSetName: + - -g -s --api-id --version-id --definition-id --format --specification --value + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/clitest000005/importSpecification?api-version=2024-03-01 + response: + body: + string: '' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 17 May 2024 05:18:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: FF0514417E8C4BB587C6D8F51C8F8D24 Ref B: MAA201060513035 Ref C: 2024-05-17T05:18:36Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api definition export-specification + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -s --api-id --version-id --definition-id --file-name + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/clitest000005/exportSpecification?api-version=2024-03-01 + response: + body: + string: '{"format":"inline","value":"{\r\n \"openapi\": \"3.0.2\",\r\n \"info\": + {\r\n \"title\": \"Swagger Petstore - OpenAPI 3.0\",\r\n \"description\": + \"This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You + can find out more about\\nSwagger at [http://swagger.io](http://swagger.io). + In the third iteration of the pet store, we''ve switched to the design first + approach!\\nYou can now help us improve the API whether it''s by making changes + to the definition itself or to the code.\\nThat way, with time, we can improve + the API in general, and expose some of the new features in OAS3.\\n\\nSome + useful links:\\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\\n- + [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)\",\r\n \"termsOfService\": + \"http://swagger.io/terms/\",\r\n \"contact\": {\r\n \"email\": + \"apiteam@swagger.io\"\r\n },\r\n \"license\": {\r\n \"name\": + \"Apache 2.0\",\r\n \"url\": \"http://www.apache.org/licenses/LICENSE-2.0.html\"\r\n },\r\n \"version\": + \"1.0.19\"\r\n },\r\n \"externalDocs\": {\r\n \"description\": + \"Find out more about Swagger\",\r\n \"url\": \"http://swagger.io\"\r\n },\r\n \"servers\": + [\r\n {\r\n \"url\": \"/api/v3\"\r\n }\r\n ],\r\n \"tags\": + [\r\n {\r\n \"name\": \"pet\",\r\n \"description\": + \"Everything about your Pets\",\r\n \"externalDocs\": {\r\n \"description\": + \"Find out more\",\r\n \"url\": \"http://swagger.io\"\r\n }\r\n },\r\n {\r\n \"name\": + \"store\",\r\n \"description\": \"Access to Petstore orders\",\r\n \"externalDocs\": + {\r\n \"description\": \"Find out more about our store\",\r\n \"url\": + \"http://swagger.io\"\r\n }\r\n },\r\n {\r\n \"name\": + \"user\",\r\n \"description\": \"Operations about user\"\r\n }\r\n ],\r\n \"paths\": + {\r\n \"/pet\": {\r\n \"put\": {\r\n \"tags\": + [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Update an existing pet\",\r\n \"description\": \"Update an + existing pet by Id\",\r\n \"operationId\": \"updatePet\",\r\n \"requestBody\": + {\r\n \"description\": \"Update an existent pet in the + store\",\r\n \"content\": {\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/x-www-form-urlencoded\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n },\r\n \"required\": + true\r\n },\r\n \"responses\": {\r\n \"200\": + {\r\n \"description\": \"Successful operation\",\r\n \"content\": + {\r\n \"application/xml\": {\r\n \"schema\": + {\r\n \"$ref\": \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid ID supplied\"\r\n },\r\n \"404\": + {\r\n \"description\": \"Pet not found\"\r\n },\r\n \"405\": + {\r\n \"description\": \"Validation exception\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n },\r\n \"post\": + {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Add a new pet to the store\",\r\n \"description\": \"Add + a new pet to the store\",\r\n \"operationId\": \"addPet\",\r\n \"requestBody\": + {\r\n \"description\": \"Create a new pet in the store\",\r\n \"content\": + {\r\n \"application/json\": {\r\n \"schema\": + {\r\n \"$ref\": \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/x-www-form-urlencoded\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n },\r\n \"required\": + true\r\n },\r\n \"responses\": {\r\n \"200\": + {\r\n \"description\": \"Successful operation\",\r\n \"content\": + {\r\n \"application/xml\": {\r\n \"schema\": + {\r\n \"$ref\": \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n }\r\n },\r\n \"405\": + {\r\n \"description\": \"Invalid input\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n }\r\n },\r\n \"/pet/findByStatus\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Finds Pets by status\",\r\n \"description\": \"Multiple status + values can be provided with comma separated strings\",\r\n \"operationId\": + \"findPetsByStatus\",\r\n \"parameters\": [\r\n {\r\n \"name\": + \"status\",\r\n \"in\": \"query\",\r\n \"description\": + \"Status values that need to be considered for filter\",\r\n \"required\": + false,\r\n \"explode\": true,\r\n \"schema\": + {\r\n \"type\": \"string\",\r\n \"default\": + \"available\",\r\n \"enum\": [\r\n \"available\",\r\n \"pending\",\r\n \"sold\"\r\n ]\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"type\": + \"array\",\r\n \"items\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"type\": + \"array\",\r\n \"items\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid status value\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n }\r\n },\r\n \"/pet/findByTags\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Finds Pets by tags\",\r\n \"description\": \"Multiple tags + can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.\",\r\n \"operationId\": + \"findPetsByTags\",\r\n \"parameters\": [\r\n {\r\n \"name\": + \"tags\",\r\n \"in\": \"query\",\r\n \"description\": + \"Tags to filter by\",\r\n \"required\": false,\r\n \"explode\": + true,\r\n \"schema\": {\r\n \"type\": + \"array\",\r\n \"items\": {\r\n \"type\": + \"string\"\r\n }\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"type\": + \"array\",\r\n \"items\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"type\": + \"array\",\r\n \"items\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid tag value\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n }\r\n },\r\n \"/pet/{petId}\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Find pet by ID\",\r\n \"description\": \"Returns a single + pet\",\r\n \"operationId\": \"getPetById\",\r\n \"parameters\": + [\r\n {\r\n \"name\": \"petId\",\r\n \"in\": + \"path\",\r\n \"description\": \"ID of pet to return\",\r\n \"required\": + true,\r\n \"schema\": {\r\n \"type\": + \"integer\",\r\n \"format\": \"int64\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid ID supplied\"\r\n },\r\n \"404\": + {\r\n \"description\": \"Pet not found\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"api_key\": []\r\n },\r\n {\r\n \"petstore_auth\": + [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n },\r\n \"post\": + {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Updates a pet in the store with form data\",\r\n \"description\": + \"\",\r\n \"operationId\": \"updatePetWithForm\",\r\n \"parameters\": + [\r\n {\r\n \"name\": \"petId\",\r\n \"in\": + \"path\",\r\n \"description\": \"ID of pet that needs + to be updated\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\"\r\n }\r\n },\r\n {\r\n \"name\": + \"name\",\r\n \"in\": \"query\",\r\n \"description\": + \"Name of pet that needs to be updated\",\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n {\r\n \"name\": + \"status\",\r\n \"in\": \"query\",\r\n \"description\": + \"Status of pet that needs to be updated\",\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"405\": {\r\n \"description\": + \"Invalid input\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n },\r\n \"delete\": + {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"Deletes a pet\",\r\n \"description\": \"\",\r\n \"operationId\": + \"deletePet\",\r\n \"parameters\": [\r\n {\r\n \"name\": + \"api_key\",\r\n \"in\": \"header\",\r\n \"description\": + \"\",\r\n \"required\": false,\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n {\r\n \"name\": + \"petId\",\r\n \"in\": \"path\",\r\n \"description\": + \"Pet id to delete\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"400\": {\r\n \"description\": + \"Invalid pet value\"\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n }\r\n },\r\n \"/pet/{petId}/uploadImage\": + {\r\n \"post\": {\r\n \"tags\": [\r\n \"pet\"\r\n ],\r\n \"summary\": + \"uploads an image\",\r\n \"description\": \"\",\r\n \"operationId\": + \"uploadFile\",\r\n \"parameters\": [\r\n {\r\n \"name\": + \"petId\",\r\n \"in\": \"path\",\r\n \"description\": + \"ID of pet to update\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\"\r\n }\r\n },\r\n {\r\n \"name\": + \"additionalMetadata\",\r\n \"in\": \"query\",\r\n \"description\": + \"Additional Metadata\",\r\n \"required\": false,\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n }\r\n ],\r\n \"requestBody\": + {\r\n \"content\": {\r\n \"application/octet-stream\": + {\r\n \"schema\": {\r\n \"type\": + \"string\",\r\n \"format\": \"binary\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/ApiResponse\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"petstore_auth\": [\r\n \"write:pets\",\r\n \"read:pets\"\r\n ]\r\n }\r\n ]\r\n }\r\n },\r\n \"/store/inventory\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"store\"\r\n ],\r\n \"summary\": + \"Returns pet inventories by status\",\r\n \"description\": + \"Returns a map of status codes to quantities\",\r\n \"operationId\": + \"getInventory\",\r\n \"responses\": {\r\n \"200\": + {\r\n \"description\": \"successful operation\",\r\n \"content\": + {\r\n \"application/json\": {\r\n \"schema\": + {\r\n \"type\": \"object\",\r\n \"additionalProperties\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int32\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"security\": + [\r\n {\r\n \"api_key\": []\r\n }\r\n ]\r\n }\r\n },\r\n \"/store/order\": + {\r\n \"post\": {\r\n \"tags\": [\r\n \"store\"\r\n ],\r\n \"summary\": + \"Place an order for a pet\",\r\n \"description\": \"Place + a new order in the store\",\r\n \"operationId\": \"placeOrder\",\r\n \"requestBody\": + {\r\n \"content\": {\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Order\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Order\"\r\n }\r\n },\r\n \"application/x-www-form-urlencoded\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Order\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Order\"\r\n }\r\n }\r\n }\r\n },\r\n \"405\": + {\r\n \"description\": \"Invalid input\"\r\n }\r\n }\r\n }\r\n },\r\n \"/store/order/{orderId}\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"store\"\r\n ],\r\n \"summary\": + \"Find purchase order by ID\",\r\n \"description\": \"For valid + response try integer IDs with value <= 5 or > 10. Other values will generate + exceptions.\",\r\n \"operationId\": \"getOrderById\",\r\n \"parameters\": + [\r\n {\r\n \"name\": \"orderId\",\r\n \"in\": + \"path\",\r\n \"description\": \"ID of order that needs + to be fetched\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Order\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Order\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid ID supplied\"\r\n },\r\n \"404\": + {\r\n \"description\": \"Order not found\"\r\n }\r\n }\r\n },\r\n \"delete\": + {\r\n \"tags\": [\r\n \"store\"\r\n ],\r\n \"summary\": + \"Delete purchase order by ID\",\r\n \"description\": \"For + valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers + will generate API errors\",\r\n \"operationId\": \"deleteOrder\",\r\n \"parameters\": + [\r\n {\r\n \"name\": \"orderId\",\r\n \"in\": + \"path\",\r\n \"description\": \"ID of the order that + needs to be deleted\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"400\": {\r\n \"description\": + \"Invalid ID supplied\"\r\n },\r\n \"404\": + {\r\n \"description\": \"Order not found\"\r\n }\r\n }\r\n }\r\n },\r\n \"/user\": + {\r\n \"post\": {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Create user\",\r\n \"description\": \"This can only be done + by the logged in user.\",\r\n \"operationId\": \"createUser\",\r\n \"requestBody\": + {\r\n \"description\": \"Created user object\",\r\n \"content\": + {\r\n \"application/json\": {\r\n \"schema\": + {\r\n \"$ref\": \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/x-www-form-urlencoded\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": + {\r\n \"default\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"/user/createWithList\": + {\r\n \"post\": {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Creates list of users with given input array\",\r\n \"description\": + \"Creates list of users with given input array\",\r\n \"operationId\": + \"createUsersWithListInput\",\r\n \"requestBody\": {\r\n \"content\": + {\r\n \"application/json\": {\r\n \"schema\": + {\r\n \"type\": \"array\",\r\n \"items\": + {\r\n \"$ref\": \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"Successful operation\",\r\n \"content\": {\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n },\r\n \"default\": + {\r\n \"description\": \"successful operation\"\r\n }\r\n }\r\n }\r\n },\r\n \"/user/login\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Logs user into the system\",\r\n \"description\": \"\",\r\n \"operationId\": + \"loginUser\",\r\n \"parameters\": [\r\n {\r\n \"name\": + \"username\",\r\n \"in\": \"query\",\r\n \"description\": + \"The user name for login\",\r\n \"required\": false,\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n {\r\n \"name\": + \"password\",\r\n \"in\": \"query\",\r\n \"description\": + \"The password for login in clear text\",\r\n \"required\": + false,\r\n \"schema\": {\r\n \"type\": + \"string\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"headers\": {\r\n \"X-Rate-Limit\": + {\r\n \"description\": \"calls per hour allowed + by the user\",\r\n \"schema\": {\r\n \"type\": + \"integer\",\r\n \"format\": \"int32\"\r\n }\r\n },\r\n \"X-Expires-After\": + {\r\n \"description\": \"date in UTC when token + expires\",\r\n \"schema\": {\r\n \"type\": + \"string\",\r\n \"format\": \"date-time\"\r\n }\r\n }\r\n },\r\n \"content\": + {\r\n \"application/xml\": {\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"type\": + \"string\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid username/password + supplied\"\r\n }\r\n }\r\n }\r\n },\r\n \"/user/logout\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Logs out current logged in user session\",\r\n \"description\": + \"\",\r\n \"operationId\": \"logoutUser\",\r\n \"parameters\": + [],\r\n \"responses\": {\r\n \"default\": + {\r\n \"description\": \"successful operation\"\r\n }\r\n }\r\n }\r\n },\r\n \"/user/{username}\": + {\r\n \"get\": {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Get user by user name\",\r\n \"description\": \"\",\r\n \"operationId\": + \"getUserByName\",\r\n \"parameters\": [\r\n {\r\n \"name\": + \"username\",\r\n \"in\": \"path\",\r\n \"description\": + \"The name that needs to be fetched. Use user1 for testing. \",\r\n \"required\": + true,\r\n \"schema\": {\r\n \"type\": + \"string\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"200\": {\r\n \"description\": + \"successful operation\",\r\n \"content\": {\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n },\r\n \"400\": + {\r\n \"description\": \"Invalid username supplied\"\r\n },\r\n \"404\": + {\r\n \"description\": \"User not found\"\r\n }\r\n }\r\n },\r\n \"put\": + {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Update user\",\r\n \"description\": \"This can only be done + by the logged in user.\",\r\n \"operationId\": \"updateUser\",\r\n \"parameters\": + [\r\n {\r\n \"name\": \"username\",\r\n \"in\": + \"path\",\r\n \"description\": \"name that needs to + be updated\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n }\r\n ],\r\n \"requestBody\": + {\r\n \"description\": \"Update an existent user in the + store\",\r\n \"content\": {\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n },\r\n \"application/x-www-form-urlencoded\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n },\r\n \"responses\": + {\r\n \"default\": {\r\n \"description\": + \"successful operation\"\r\n }\r\n }\r\n },\r\n \"delete\": + {\r\n \"tags\": [\r\n \"user\"\r\n ],\r\n \"summary\": + \"Delete user\",\r\n \"description\": \"This can only be done + by the logged in user.\",\r\n \"operationId\": \"deleteUser\",\r\n \"parameters\": + [\r\n {\r\n \"name\": \"username\",\r\n \"in\": + \"path\",\r\n \"description\": \"The name that needs + to be deleted\",\r\n \"required\": true,\r\n \"schema\": + {\r\n \"type\": \"string\"\r\n }\r\n }\r\n ],\r\n \"responses\": + {\r\n \"400\": {\r\n \"description\": + \"Invalid username supplied\"\r\n },\r\n \"404\": + {\r\n \"description\": \"User not found\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"components\": + {\r\n \"schemas\": {\r\n \"Order\": {\r\n \"type\": + \"object\",\r\n \"properties\": {\r\n \"id\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\",\r\n \"example\": 10\r\n },\r\n \"petId\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\",\r\n \"example\": 198772\r\n },\r\n \"quantity\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int32\",\r\n \"example\": 7\r\n },\r\n \"shipDate\": + {\r\n \"type\": \"string\",\r\n \"format\": + \"date-time\"\r\n },\r\n \"status\": + {\r\n \"type\": \"string\",\r\n \"description\": + \"Order Status\",\r\n \"example\": \"approved\",\r\n \"enum\": + [\r\n \"placed\",\r\n \"approved\",\r\n \"delivered\"\r\n ]\r\n },\r\n \"complete\": + {\r\n \"type\": \"boolean\"\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"order\"\r\n }\r\n },\r\n \"Customer\": + {\r\n \"type\": \"object\",\r\n \"properties\": + {\r\n \"id\": {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\",\r\n \"example\": 100000\r\n },\r\n \"username\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"fehguy\"\r\n },\r\n \"address\": {\r\n \"type\": + \"array\",\r\n \"xml\": {\r\n \"name\": + \"addresses\",\r\n \"wrapped\": true\r\n },\r\n \"items\": + {\r\n \"$ref\": \"#/components/schemas/Address\"\r\n }\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"customer\"\r\n }\r\n },\r\n \"Address\": + {\r\n \"type\": \"object\",\r\n \"properties\": + {\r\n \"street\": {\r\n \"type\": + \"string\",\r\n \"example\": \"437 Lytton\"\r\n },\r\n \"city\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"Palo Alto\"\r\n },\r\n \"state\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"CA\"\r\n },\r\n \"zip\": {\r\n \"type\": + \"string\",\r\n \"example\": \"94301\"\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"address\"\r\n }\r\n },\r\n \"Category\": + {\r\n \"type\": \"object\",\r\n \"properties\": + {\r\n \"id\": {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\",\r\n \"example\": 1\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"Dogs\"\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"category\"\r\n }\r\n },\r\n \"User\": + {\r\n \"type\": \"object\",\r\n \"properties\": + {\r\n \"id\": {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\",\r\n \"example\": 10\r\n },\r\n \"username\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"theUser\"\r\n },\r\n \"firstName\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"John\"\r\n },\r\n \"lastName\": {\r\n \"type\": + \"string\",\r\n \"example\": \"James\"\r\n },\r\n \"email\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"john@email.com\"\r\n },\r\n \"password\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"12345\"\r\n },\r\n \"phone\": {\r\n \"type\": + \"string\",\r\n \"example\": \"12345\"\r\n },\r\n \"userStatus\": + {\r\n \"type\": \"integer\",\r\n \"description\": + \"User Status\",\r\n \"format\": \"int32\",\r\n \"example\": + 1\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"user\"\r\n }\r\n },\r\n \"Tag\": + {\r\n \"type\": \"object\",\r\n \"properties\": + {\r\n \"id\": {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\"\r\n },\r\n \"name\": {\r\n \"type\": + \"string\"\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"tag\"\r\n }\r\n },\r\n \"Pet\": + {\r\n \"required\": [\r\n \"name\",\r\n \"photoUrls\"\r\n ],\r\n \"type\": + \"object\",\r\n \"properties\": {\r\n \"id\": + {\r\n \"type\": \"integer\",\r\n \"format\": + \"int64\",\r\n \"example\": 10\r\n },\r\n \"name\": + {\r\n \"type\": \"string\",\r\n \"example\": + \"doggie\"\r\n },\r\n \"category\": + {\r\n \"$ref\": \"#/components/schemas/Category\"\r\n },\r\n \"photoUrls\": + {\r\n \"type\": \"array\",\r\n \"xml\": + {\r\n \"wrapped\": true\r\n },\r\n \"items\": + {\r\n \"type\": \"string\",\r\n \"xml\": + {\r\n \"name\": \"photoUrl\"\r\n }\r\n }\r\n },\r\n \"tags\": + {\r\n \"type\": \"array\",\r\n \"xml\": + {\r\n \"wrapped\": true\r\n },\r\n \"items\": + {\r\n \"$ref\": \"#/components/schemas/Tag\"\r\n }\r\n },\r\n \"status\": + {\r\n \"type\": \"string\",\r\n \"description\": + \"pet status in the store\",\r\n \"enum\": [\r\n \"available\",\r\n \"pending\",\r\n \"sold\"\r\n ]\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"pet\"\r\n }\r\n },\r\n \"ApiResponse\": + {\r\n \"type\": \"object\",\r\n \"properties\": + {\r\n \"code\": {\r\n \"type\": + \"integer\",\r\n \"format\": \"int32\"\r\n },\r\n \"type\": + {\r\n \"type\": \"string\"\r\n },\r\n \"message\": + {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"xml\": + {\r\n \"name\": \"##default\"\r\n }\r\n }\r\n },\r\n \"requestBodies\": + {\r\n \"Pet\": {\r\n \"description\": \"Pet object + that needs to be added to the store\",\r\n \"content\": {\r\n \"application/json\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n },\r\n \"application/xml\": + {\r\n \"schema\": {\r\n \"$ref\": + \"#/components/schemas/Pet\"\r\n }\r\n }\r\n }\r\n },\r\n \"UserArray\": + {\r\n \"description\": \"List of user object\",\r\n \"content\": + {\r\n \"application/json\": {\r\n \"schema\": + {\r\n \"type\": \"array\",\r\n \"items\": + {\r\n \"$ref\": \"#/components/schemas/User\"\r\n }\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"securitySchemes\": + {\r\n \"petstore_auth\": {\r\n \"type\": \"oauth2\",\r\n \"flows\": + {\r\n \"implicit\": {\r\n \"authorizationUrl\": + \"https://petstore3.swagger.io/oauth/authorize\",\r\n \"scopes\": + {\r\n \"write:pets\": \"modify pets in your account\",\r\n \"read:pets\": + \"read your pets\"\r\n }\r\n }\r\n }\r\n },\r\n \"api_key\": + {\r\n \"type\": \"apiKey\",\r\n \"name\": \"api_key\",\r\n \"in\": + \"header\"\r\n }\r\n }\r\n }\r\n}"}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '50209' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 May 2024 05:18:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: 967469667E9D4C13B50DE29BE13B030F Ref B: MAA201060516035 Ref C: 2024-05-17T05:18:39Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_list_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_list_with_all_optional_params.yaml new file mode 100644 index 00000000000..d38ecfcb60c --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_list_with_all_optional_params.yaml @@ -0,0 +1,52 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api definition list + Connection: + - keep-alive + ParameterSetName: + - -g -s --api-id --version-id --filter + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions?$filter=name%20eq%20%27clitest000005%27&api-version=2024-03-01 + response: + body: + string: '{"value":[{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions/definitions","properties":{"title":"OpenAPI"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/clitest000005","name":"clitest000005","systemData":{"createdAt":"2024-05-16T08:38:01.7297819Z","lastModifiedAt":"2024-05-16T08:38:01.7297809Z"}}]}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '476' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 16 May 2024 08:38:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 007548D3D9D94C28BD5D65C425DED177 Ref B: MAA201060516047 Ref C: 2024-05-16T08:38:06Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_update.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_update.yaml index de346592fa1..55d11650a7c 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_update.yaml +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_definition_update.yaml @@ -11,14 +11,14 @@ interactions: Connection: - keep-alive ParameterSetName: - - -g -s --api-id --version-id --definition-id --title + - -g -s --api-id --version-id --definition-id --title --description User-Agent: - - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/clitest000005?api-version=2024-03-01 response: body: - string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions/definitions","properties":{"title":"OpenAPI"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/clitest000005","name":"clitest000005","systemData":{"createdAt":"2024-05-07T12:36:23.4679946Z","lastModifiedAt":"2024-05-07T12:36:23.4679933Z"}}' + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions/definitions","properties":{"title":"OpenAPI"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/clitest000005","name":"clitest000005","systemData":{"createdAt":"2024-05-16T08:37:19.5368981Z","lastModifiedAt":"2024-05-16T08:37:19.5368975Z"}}' headers: api-supported-versions: - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview @@ -29,9 +29,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 07 May 2024 12:36:26 GMT + - Thu, 16 May 2024 08:37:21 GMT etag: - - 2f04d9ec-0000-0100-0000-663a20470000 + - 42001a69-0000-0100-0000-6645c5bf0000 expires: - '-1' pragma: @@ -45,14 +45,14 @@ interactions: x-content-type-options: - nosniff x-msedge-ref: - - 'Ref A: BD7CC0F983624D0CB8F5C5788CE94C54 Ref B: MAA201060515009 Ref C: 2024-05-07T12:36:24Z' + - 'Ref A: 7BE7780F150A4B8CB0DAD5ED283FD8E7 Ref B: MAA201060516011 Ref C: 2024-05-16T08:37:21Z' x-powered-by: - ASP.NET status: code: 200 message: OK - request: - body: '{"properties": {"title": "Swagger"}}' + body: '{"properties": {"description": "test description 2", "title": "Swagger"}}' headers: Accept: - application/json @@ -63,31 +63,32 @@ interactions: Connection: - keep-alive Content-Length: - - '36' + - '73' Content-Type: - application/json ParameterSetName: - - -g -s --api-id --version-id --definition-id --title + - -g -s --api-id --version-id --definition-id --title --description User-Agent: - - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/clitest000005?api-version=2024-03-01 response: body: - string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions/definitions","properties":{"title":"Swagger"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/clitest000005","name":"clitest000005","systemData":{"lastModifiedAt":"2024-05-07T12:36:28.0864953Z"}}' + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions/definitions","properties":{"title":"Swagger","description":"test + description 2"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004/definitions/clitest000005","name":"clitest000005","systemData":{"lastModifiedAt":"2024-05-16T08:37:24.0171687Z"}}' headers: api-supported-versions: - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview cache-control: - no-cache content-length: - - '421' + - '456' content-type: - application/json; charset=utf-8 date: - - Tue, 07 May 2024 12:36:28 GMT + - Thu, 16 May 2024 08:37:23 GMT etag: - - 2f04f5ed-0000-0100-0000-663a204c0000 + - 42004769-0000-0100-0000-6645c5c40000 expires: - '-1' pragma: @@ -101,9 +102,9 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' x-msedge-ref: - - 'Ref A: F125D8FEE6524EBAA96609B4E4AB6039 Ref B: MAA201060515009 Ref C: 2024-05-07T12:36:26Z' + - 'Ref A: B5C29BCEA7EB4C11A3FB298C39156AE6 Ref B: MAA201060516011 Ref C: 2024-05-16T08:37:22Z' x-powered-by: - ASP.NET status: diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_delete_service.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_delete_service.yaml index 67d235a859e..d4319ec8085 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_delete_service.yaml +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_delete_service.yaml @@ -15,17 +15,21 @@ interactions: ParameterSetName: - -g -s --yes User-Agent: - - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002a?api-version=2024-03-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002?api-version=2024-03-01 response: body: string: '' headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview cache-control: - no-cache + content-length: + - '0' date: - - Thu, 25 Apr 2024 05:47:24 GMT + - Fri, 17 May 2024 05:03:39 GMT expires: - '-1' pragma: @@ -39,8 +43,58 @@ interactions: x-ms-ratelimit-remaining-subscription-deletes: - '14999' x-msedge-ref: - - 'Ref A: 50BEA56C7F8448F2A9889B4487CB4C1A Ref B: MAA201060516021 Ref C: 2024-04-25T05:47:25Z' + - 'Ref A: D0045B874A554F9B9E64B2FC1D1A8E5A Ref B: MAA201060514033 Ref C: 2024-05-17T05:03:35Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic service show + Connection: + - keep-alive + ParameterSetName: + - -g -s + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002?api-version=2024-03-01 + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.ApiCenter/services/clitest000002'' + under resource group ''clirg000001'' was not found. For more details please + go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '225' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 May 2024 05:03:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + x-msedge-ref: + - 'Ref A: 219F8D63770B45668E30C56B5FD51B7C Ref B: MAA201060516033 Ref C: 2024-05-17T05:03:41Z' status: - code: 204 - message: No Content + code: 404 + message: Not Found version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_deployment_create_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_deployment_create_with_all_optional_params.yaml new file mode 100644 index 00000000000..4c710b23717 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_deployment_create_with_all_optional_params.yaml @@ -0,0 +1,66 @@ +interactions: +- request: + body: '{"properties": {"customProperties": {"clitest000007": true}, "definitionId": + "/workspaces/default/apis/clitest000004/versions/clitest000005/definitions/clitest000006", + "description": "deployment description", "environmentId": "/workspaces/default/environments/clitest000003", + "server": {"runtimeUri": ["https://example.com"]}, "state": "active", "title": + "test deployment"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api deployment create + Connection: + - keep-alive + Content-Length: + - '374' + Content-Type: + - application/json + ParameterSetName: + - -g -s --api-id --definition-id --environment-id --deployment-id --title --server + --description --state --custom-properties + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000004/deployments/mock-deployment?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/deployments","properties":{"title":"test + deployment","description":"deployment description","environmentId":"/workspaces/default/environments/clitest000003","definitionId":"/workspaces/default/apis/clitest000004/versions/clitest000005/definitions/clitest000006","server":{"runtimeUri":["https://example.com"]},"customProperties":{"clitest000007":true},"recommended":false},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000004/deployments/cli000008","name":"cli000008","systemData":{"createdAt":"2024-05-17T05:03:38.370645Z","lastModifiedAt":"2024-05-17T05:03:38.3706282Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '750' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 May 2024 05:03:38 GMT + etag: + - 4b011192-0000-0100-0000-6646e52a0000 + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: 19D3A21284B740909A39DFD512E47B9C Ref B: MAA201060516051 Ref C: 2024-05-17T05:03:36Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_deployment_delete.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_deployment_delete.yaml index 2469652307e..1bfee02a533 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_deployment_delete.yaml +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_deployment_delete.yaml @@ -27,7 +27,7 @@ interactions: cache-control: - no-cache date: - - Wed, 08 May 2024 06:33:39 GMT + - Fri, 17 May 2024 03:19:11 GMT expires: - '-1' pragma: @@ -41,7 +41,7 @@ interactions: x-ms-ratelimit-remaining-subscription-deletes: - '14999' x-msedge-ref: - - 'Ref A: 14721096882D4A6E91B43F7F1338140E Ref B: MAA201060515017 Ref C: 2024-05-08T06:33:37Z' + - 'Ref A: C12AE808D53942E0A538081BAC7C0688 Ref B: MAA201060514053 Ref C: 2024-05-17T03:19:11Z' x-powered-by: - ASP.NET status: @@ -77,7 +77,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 08 May 2024 06:33:41 GMT + - Fri, 17 May 2024 03:19:13 GMT expires: - '-1' pragma: @@ -91,7 +91,7 @@ interactions: x-content-type-options: - nosniff x-msedge-ref: - - 'Ref A: 73A4BFBDAF8249DABDFBC1445BE4BB34 Ref B: MAA201060515029 Ref C: 2024-05-08T06:33:40Z' + - 'Ref A: E210093F1CA8405FB3680BD8F49E2631 Ref B: MAA201060516035 Ref C: 2024-05-17T03:19:13Z' x-powered-by: - ASP.NET status: diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_deployment_list_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_deployment_list_with_all_optional_params.yaml new file mode 100644 index 00000000000..5ccb567a4df --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_deployment_list_with_all_optional_params.yaml @@ -0,0 +1,53 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api deployment list + Connection: + - keep-alive + ParameterSetName: + - -g -s --api-id --filter + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000004/deployments?$filter=name%20eq%20%27clitest000007%27&api-version=2024-03-01 + response: + body: + string: '{"value":[{"type":"Microsoft.ApiCenter/services/workspaces/apis/deployments","properties":{"title":"test + deployment","environmentId":"/workspaces/default/environments/clitest000003","definitionId":"/workspaces/default/apis/clitest000004/versions/clitest000005/definitions/clitest000006","server":{"runtimeUri":["https://example.com"]},"customProperties":{},"recommended":false},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000004/deployments/clitest000007","name":"clitest000007","systemData":{"createdAt":"2024-05-17T02:54:50.9103478Z","lastModifiedAt":"2024-05-17T02:54:50.9103462Z"}}]}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '712' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 May 2024 02:54:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 565B79A7B2AE4F6197AFD32258D9C18D Ref B: MAA201060516047 Ref C: 2024-05-17T02:54:55Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_deployment_update_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_deployment_update_with_all_optional_params.yaml new file mode 100644 index 00000000000..d8a33e2a990 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_deployment_update_with_all_optional_params.yaml @@ -0,0 +1,120 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api deployment update + Connection: + - keep-alive + ParameterSetName: + - -g -s --api-id --definition-id --environment-id --deployment-id --title --server + --description --state --custom-properties + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000004/deployments/mock-deployment?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/deployments","properties":{"title":"test + deployment","environmentId":"/workspaces/default/environments/clitest000003","definitionId":"/workspaces/default/apis/clitest000004/versions/clitest000005/definitions/clitest000006","server":{"runtimeUri":["https://example.com"]},"customProperties":{},"recommended":false},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000004/deployments/clitest000007","name":"clitest000007","systemData":{"createdAt":"2024-05-17T05:03:38.7020373Z","lastModifiedAt":"2024-05-17T05:03:38.7020356Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '700' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 May 2024 05:03:42 GMT + etag: + - 4b012792-0000-0100-0000-6646e52a0000 + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 2E0CB01190A347AB9D7DC30410062AAB Ref B: MAA201060515025 Ref C: 2024-05-17T05:03:42Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"customProperties": {"clitest000008": true}, "definitionId": + "/workspaces/default/apis/clitest000004/versions/clitest000005/definitions/clitest000006", + "description": "deployment description", "environmentId": "/workspaces/default/environments/clitest000003", + "server": {"runtimeUri": ["https://example2.com"]}, "state": "active", "title": + "updated deployment"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api deployment update + Connection: + - keep-alive + Content-Length: + - '378' + Content-Type: + - application/json + ParameterSetName: + - -g -s --api-id --definition-id --environment-id --deployment-id --title --server + --description --state --custom-properties + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000004/deployments/mock-deployment?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/deployments","properties":{"title":"updated + deployment","description":"deployment description","environmentId":"/workspaces/default/environments/clitest000003","definitionId":"/workspaces/default/apis/clitest000004/versions/clitest000005/definitions/clitest000006","server":{"runtimeUri":["https://example2.com"]},"customProperties":{"clitest000008":true},"recommended":false},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000004/deployments/clitest000007","name":"clitest000007","systemData":{"lastModifiedAt":"2024-05-17T05:03:45.5851056Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '720' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 May 2024 05:03:45 GMT + etag: + - 4b01ce93-0000-0100-0000-6646e5310000 + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: BB7D7D2A30D74F56928007541C6D2794 Ref B: MAA201060515025 Ref C: 2024-05-17T05:03:43Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_environment_create_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_environment_create_with_all_optional_params.yaml new file mode 100644 index 00000000000..a51a71d048b --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_environment_create_with_all_optional_params.yaml @@ -0,0 +1,68 @@ +interactions: +- request: + body: '{"properties": {"customProperties": {"clitest000003": true}, "description": + "environment description", "kind": "testing", "onboarding": {"developerPortalUri": + ["https://developer.contoso.com"], "instructions": "instructions markdown"}, + "server": {"managementPortalUri": ["example.com"], "type": "Azure API Management"}, + "title": "test environment"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic environment create + Connection: + - keep-alive + Content-Length: + - '349' + Content-Type: + - application/json + ParameterSetName: + - -g -s --environment-id --title --type --custom-properties --description --onboarding + --server + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/environments/cli000004?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/environments","properties":{"title":"test + environment","kind":"testing","description":"environment description","server":{"type":"Azure + API Management","managementPortalUri":["example.com"]},"onboarding":{"instructions":"instructions + markdown","developerPortalUri":["https://developer.contoso.com"]},"customProperties":{"clitest000003":true}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/environments/cli000004","name":"cli000004","systemData":{"createdAt":"2024-05-16T02:36:40.9180332Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '650' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 16 May 2024 02:36:40 GMT + etag: + - 81006d17-0000-0100-0000-664571380000 + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: 54B207DA711C470AAFFFC82F46B0BFAA Ref B: MAA201060513049 Ref C: 2024-05-16T02:36:39Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_environment_delete.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_environment_delete.yaml index 3245252836a..8bb7665aacc 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_environment_delete.yaml +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_environment_delete.yaml @@ -27,7 +27,7 @@ interactions: cache-control: - no-cache date: - - Tue, 07 May 2024 11:18:21 GMT + - Fri, 17 May 2024 03:18:32 GMT expires: - '-1' pragma: @@ -41,10 +41,60 @@ interactions: x-ms-ratelimit-remaining-subscription-deletes: - '14999' x-msedge-ref: - - 'Ref A: 7E01BC5AD4D44DE2AFB97D0DFCDFFFBE Ref B: MAA201060515021 Ref C: 2024-05-07T11:18:20Z' + - 'Ref A: 82423FE39C6A4EB9AAC95C7FBBA31DFB Ref B: MAA201060515009 Ref C: 2024-05-17T03:18:31Z' x-powered-by: - ASP.NET status: code: 204 message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic environment show + Connection: + - keep-alive + ParameterSetName: + - -g -s --environment-id + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/environments/clitest000003?api-version=2024-03-01 + response: + body: + string: '{"code":"404","message":"Subscription not found","target":"1756abc0-3554-4341-8d6a-46674962ea19"}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '97' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 May 2024 03:18:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 0AB9961F9FCE43288FCCB8DC4D065468 Ref B: MAA201060516021 Ref C: 2024-05-17T03:18:33Z' + x-powered-by: + - ASP.NET + status: + code: 404 + message: Not Found version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_environment_list_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_environment_list_with_all_optional_params.yaml new file mode 100644 index 00000000000..2baa7f49e85 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_environment_list_with_all_optional_params.yaml @@ -0,0 +1,53 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic environment list + Connection: + - keep-alive + ParameterSetName: + - -g -s --filter + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/environments?$filter=name%20eq%20%27clitest000003%27&api-version=2024-03-01 + response: + body: + string: '{"value":[{"type":"Microsoft.ApiCenter/services/workspaces/environments","properties":{"title":"test + environment","kind":"testing","customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/environments/clitest000003","name":"clitest000003","systemData":{"createdAt":"2024-05-16T05:11:32.4599502Z"}}]}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '422' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 16 May 2024 05:11:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 7F7BEF0EDCC043C7BAB99BFDF3F63EF5 Ref B: MAA201060514009 Ref C: 2024-05-16T05:11:36Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_environment_update_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_environment_update_with_all_optional_params.yaml new file mode 100644 index 00000000000..59aad50a742 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_environment_update_with_all_optional_params.yaml @@ -0,0 +1,122 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic environment update + Connection: + - keep-alive + ParameterSetName: + - -g -s --environment-id --title --type --custom-properties --description --onboarding + --server + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/environments/clitest000004?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/environments","properties":{"title":"test + environment","kind":"testing","customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/environments/clitest000004","name":"clitest000004","systemData":{"createdAt":"2024-05-16T03:05:01.3174681Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '410' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 16 May 2024 03:05:03 GMT + etag: + - 810059b7-0000-0100-0000-664577dd0000 + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 464FB4A078AF44A7A3FA7040B9604C49 Ref B: MAA201060516009 Ref C: 2024-05-16T03:05:02Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"customProperties": {"clitest000003": true}, "description": + "environment description", "kind": "testing", "onboarding": {"developerPortalUri": + ["https://developer.contoso.com"], "instructions": "instructions markdown"}, + "server": {"managementPortalUri": ["example.com"], "type": "Azure API Management"}, + "title": "test environment 2"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic environment update + Connection: + - keep-alive + Content-Length: + - '351' + Content-Type: + - application/json + ParameterSetName: + - -g -s --environment-id --title --type --custom-properties --description --onboarding + --server + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/environments/clitest000004?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/environments","properties":{"title":"test + environment 2","kind":"testing","description":"environment description","server":{"type":"Azure + API Management","managementPortalUri":["example.com"]},"onboarding":{"instructions":"instructions + markdown","developerPortalUri":["https://developer.contoso.com"]},"customProperties":{"clitest000003":true}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/environments/clitest000004","name":"clitest000004","systemData":{"lastModifiedAt":"2024-05-16T03:05:05.7377759Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 16 May 2024 03:05:05 GMT + etag: + - 8100f3b7-0000-0100-0000-664577e10000 + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: 1BAFE90A707247CCA360F367703C6998 Ref B: MAA201060516009 Ref C: 2024-05-16T03:05:04Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_list_service_in_rg.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_list_service_in_rg.yaml new file mode 100644 index 00000000000..7b157aaae81 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_list_service_in_rg.yaml @@ -0,0 +1,52 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic service list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services?api-version=2024-03-01 + response: + body: + string: '{"value":[{"type":"Microsoft.ApiCenter/services","location":"eastus","sku":{"name":"Free"},"properties":{},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002","name":"clitest000002","tags":{},"systemData":{"createdAt":"2024-05-15T07:47:45.6763919Z","lastModifiedAt":"2024-05-15T07:47:45.6763836Z"}}]}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '387' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 15 May 2024 07:47:48 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 89D283DB5381427AA576BD4F443D0C71 Ref B: MAA201060516037 Ref C: 2024-05-15T07:47:47Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_metadata_delete.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_metadata_delete.yaml index 33bd3ec6b83..684ae5b0045 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_metadata_delete.yaml +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_metadata_delete.yaml @@ -27,7 +27,7 @@ interactions: cache-control: - no-cache date: - - Tue, 07 May 2024 09:49:43 GMT + - Fri, 17 May 2024 03:18:57 GMT expires: - '-1' pragma: @@ -41,10 +41,60 @@ interactions: x-ms-ratelimit-remaining-subscription-deletes: - '14999' x-msedge-ref: - - 'Ref A: 373B5E8F549340CFBDBAC181C4C41ACC Ref B: MAA201060516049 Ref C: 2024-05-07T09:49:43Z' + - 'Ref A: 797409FB1E2B46A4BB110176EDEED5E9 Ref B: MAA201060513031 Ref C: 2024-05-17T03:18:56Z' x-powered-by: - ASP.NET status: code: 204 message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic metadata show + Connection: + - keep-alive + ParameterSetName: + - -g -s --name + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/metadataSchemas/clitest000003?api-version=2024-03-01 + response: + body: + string: '{"code":"404"}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '14' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 May 2024 03:18:59 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 80187C33E11E439997D29E33E564ACFE Ref B: MAA201060515039 Ref C: 2024-05-17T03:18:58Z' + x-powered-by: + - ASP.NET + status: + code: 404 + message: Not Found version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_metadata_list_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_metadata_list_with_all_optional_params.yaml new file mode 100644 index 00000000000..d8d1be2c0b2 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_metadata_list_with_all_optional_params.yaml @@ -0,0 +1,53 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic metadata list + Connection: + - keep-alive + ParameterSetName: + - -g -s --filter + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/metadataSchemas?$filter=name%20eq%20%27clitest000003%27&api-version=2024-03-01 + response: + body: + string: '{"value":[{"type":"Microsoft.ApiCenter/services/metadataSchemas","properties":{"assignedTo":[{"entity":"api","required":true,"deprecated":false},{"entity":"environment","required":true,"deprecated":false},{"entity":"deployment","required":true,"deprecated":false}],"schema":"{\"type\":\"boolean\", + \"title\":\"Public Facing\"}"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/metadataSchemas/clitest000003","name":"clitest000003","systemData":{"createdAt":"2024-05-16T02:56:38.8827002Z","lastModifiedAt":"2024-05-16T02:56:38.8826987Z"}}]}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '629' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 16 May 2024 02:56:44 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 624FFE52946D41F894814C3A9C8D944D Ref B: MAA201060515035 Ref C: 2024-05-16T02:56:43Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_update_service_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_update_service_with_all_optional_params.yaml new file mode 100644 index 00000000000..1350c5e11ea --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_update_service_with_all_optional_params.yaml @@ -0,0 +1,60 @@ +interactions: +- request: + body: '{"identity": {"type": "SystemAssigned"}, "tags": {"test": "value"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic service update + Connection: + - keep-alive + Content-Length: + - '67' + Content-Type: + - application/json + ParameterSetName: + - -g -s --tags --identity + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: PATCH + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services","location":"eastus","identity":{"type":"SystemAssigned","principalId":"c2ef3539-0d52-4f64-a8d7-c6888542e17c","tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"},"sku":{"name":"Free"},"properties":{},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002","name":"clitest000002","tags":{"test":"value"},"systemData":{"lastModifiedAt":"2024-05-15T07:47:59.7722946Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '486' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 15 May 2024 07:48:00 GMT + etag: + - 2d0033f1-0000-0100-0000-664468af0000 + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: 4B27B6B145694297BDB83FE8474E6B17 Ref B: MAA201060514023 Ref C: 2024-05-15T07:47:54Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_version_delete.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_version_delete.yaml index 67f5beee7d9..e873bdbb4b8 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_version_delete.yaml +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_version_delete.yaml @@ -27,7 +27,7 @@ interactions: cache-control: - no-cache date: - - Tue, 07 May 2024 11:47:08 GMT + - Fri, 17 May 2024 05:03:42 GMT expires: - '-1' pragma: @@ -41,10 +41,60 @@ interactions: x-ms-ratelimit-remaining-subscription-deletes: - '14999' x-msedge-ref: - - 'Ref A: 6E15EB9C661C4A35A646B46DF9BE8D1F Ref B: MAA201060515009 Ref C: 2024-05-07T11:47:07Z' + - 'Ref A: 9F4CEA50FAA743EBBCDD62E8438BAF8F Ref B: MAA201060515047 Ref C: 2024-05-17T05:03:40Z' x-powered-by: - ASP.NET status: code: 204 message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api version show + Connection: + - keep-alive + ParameterSetName: + - -g -s --api-id --version-id + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004?api-version=2024-03-01 + response: + body: + string: '{"code":"404"}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '14' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 17 May 2024 05:03:47 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: F4F9973FD8E5489C9B20262956A7B979 Ref B: MAA201060513025 Ref C: 2024-05-17T05:03:46Z' + x-powered-by: + - ASP.NET + status: + code: 404 + message: Not Found version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_version_list_with_all_optional_params.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_version_list_with_all_optional_params.yaml new file mode 100644 index 00000000000..b765af04d7e --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_version_list_with_all_optional_params.yaml @@ -0,0 +1,52 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api version list + Connection: + - keep-alive + ParameterSetName: + - -g -s --api-id --filter + User-Agent: + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions?$filter=name%20eq%20%27clitest000004%27&api-version=2024-03-01 + response: + body: + string: '{"value":[{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"v1.0.0","lifecycleStage":"production"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004","name":"clitest000004","systemData":{"createdAt":"2024-05-16T08:37:50.415624Z","lastModifiedAt":"2024-05-16T08:37:50.4156234Z"}}]}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '466' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 16 May 2024 08:37:55 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-msedge-ref: + - 'Ref A: 766D19336AD94DCAA6E123CCE1778867 Ref B: MAA201060513017 Ref C: 2024-05-16T08:37:55Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_version_update.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_version_update.yaml index dde979e7db9..5b3a751baef 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_version_update.yaml +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_version_update.yaml @@ -11,14 +11,14 @@ interactions: Connection: - keep-alive ParameterSetName: - - -g -s --api-id --version-id --title + - -g -s --api-id --version-id --title --lifecycle-stage User-Agent: - - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004?api-version=2024-03-01 response: body: - string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"v1.0.0","lifecycleStage":"production"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004","name":"clitest000004","systemData":{"createdAt":"2024-05-07T11:47:04.6300339Z","lastModifiedAt":"2024-05-07T11:47:04.6300331Z"}}' + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"v1.0.0","lifecycleStage":"production"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004","name":"clitest000004","systemData":{"createdAt":"2024-05-16T08:37:48.5074948Z","lastModifiedAt":"2024-05-16T08:37:48.5074943Z"}}' headers: api-supported-versions: - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview @@ -29,9 +29,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 07 May 2024 11:47:07 GMT + - Thu, 16 May 2024 08:37:51 GMT etag: - - 51056def-0000-0100-0000-663a14b80000 + - a1005104-0000-0100-0000-6645c5dc0000 expires: - '-1' pragma: @@ -45,14 +45,14 @@ interactions: x-content-type-options: - nosniff x-msedge-ref: - - 'Ref A: 85B6431CD70E40E08ACE3CA8317C4A40 Ref B: MAA201060513039 Ref C: 2024-05-07T11:47:05Z' + - 'Ref A: 762DDCB4F2C84623BA288BA4E6AF867B Ref B: MAA201060516025 Ref C: 2024-05-16T08:37:50Z' x-powered-by: - ASP.NET status: code: 200 message: OK - request: - body: '{"properties": {"lifecycleStage": "production", "title": "v1.0.1"}}' + body: '{"properties": {"lifecycleStage": "development", "title": "v1.0.1"}}' headers: Accept: - application/json @@ -63,31 +63,31 @@ interactions: Connection: - keep-alive Content-Length: - - '67' + - '68' Content-Type: - application/json ParameterSetName: - - -g -s --api-id --version-id --title + - -g -s --api-id --version-id --title --lifecycle-stage User-Agent: - - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.10.11 (Windows-10-10.0.22631-SP0) + - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.9 (Windows-10-10.0.19045-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004?api-version=2024-03-01 response: body: - string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"v1.0.1","lifecycleStage":"production"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004","name":"clitest000004","systemData":{"lastModifiedAt":"2024-05-07T11:47:09.3963603Z"}}' + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"v1.0.1","lifecycleStage":"development"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/clitest000003/versions/clitest000004","name":"clitest000004","systemData":{"lastModifiedAt":"2024-05-16T08:37:53.2124531Z"}}' headers: api-supported-versions: - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview cache-control: - no-cache content-length: - - '412' + - '413' content-type: - application/json; charset=utf-8 date: - - Tue, 07 May 2024 11:47:08 GMT + - Thu, 16 May 2024 08:37:52 GMT etag: - - 510535f0-0000-0100-0000-663a14bd0000 + - a1001905-0000-0100-0000-6645c5e10000 expires: - '-1' pragma: @@ -103,7 +103,7 @@ interactions: x-ms-ratelimit-remaining-subscription-writes: - '1199' x-msedge-ref: - - 'Ref A: 6823A01055B44D95AA3561533E5B62DE Ref B: MAA201060513039 Ref C: 2024-05-07T11:47:07Z' + - 'Ref A: 3280C1649AFE4C498BDC287C3374A661 Ref B: MAA201060516025 Ref C: 2024-05-16T08:37:51Z' x-powered-by: - ASP.NET status: diff --git a/src/apic-extension/azext_apic_extension/tests/latest/test_api_commands.py b/src/apic-extension/azext_apic_extension/tests/latest/test_api_commands.py index fa470daa31c..8584b800815 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/test_api_commands.py +++ b/src/apic-extension/azext_apic_extension/tests/latest/test_api_commands.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from .utils import ApicServicePreparer, ApicApiPreparer +from .utils import ApicServicePreparer, ApicApiPreparer, ApicMetadataPreparer class ApiCommandsTests(ScenarioTest): @@ -23,6 +23,29 @@ def test_api_create(self): self.check('externalDocumentation', []) ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicMetadataPreparer() + def test_api_create_with_all_optional_params(self, metadata_name): + self.kwargs.update({ + 'name': self.create_random_name(prefix='cli', length=24), + 'contacts': '[{email:contact@example.com,name:test,url:example.com}]', + 'customProperties': '{{"{}":true}}'.format(metadata_name), + 'externalDocumentation': '[{title:\'onboarding docs\',url:example.com}]', + 'license': '{url:example.com}', + }) + self.cmd('az apic api create -g {rg} -s {s} --api-id {name} --title "test api" --type rest --contacts "{contacts}" --custom-properties \'{customProperties}\' --description "API description" --external-documentation "{externalDocumentation}" --license "{license}" --summary "summary"', checks=[ + self.check('name', '{name}'), + self.check('kind', 'rest'), + self.check('title', 'test api'), + self.check('contacts', [{"email":"contact@example.com","name":"test","url":"example.com"}]), + self.check('customProperties.{}'.format(metadata_name), True), + self.check('description', 'API description'), + self.check('externalDocumentation', [{"title":"onboarding docs","url":"example.com"}]), + self.check('license', {"url":"example.com"}), + self.check('summary', 'summary') + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @ApicApiPreparer() @@ -47,6 +70,19 @@ def test_api_list(self, api_id1, api_id2): self.check('@[1].name', api_id2) ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicApiPreparer(parameter_name='api_id1') + @ApicApiPreparer(parameter_name='api_id2') + def test_api_list_with_all_optional_params(self, api_id1): + self.kwargs.update({ + 'api_id': api_id1 + }) + self.cmd('az apic api list -g {rg} -s {s} --filter "name eq \'{api_id}\'"', checks=[ + self.check('length(@)', 1), + self.check('@[0].name', api_id1), + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @ApicApiPreparer() @@ -55,8 +91,31 @@ def test_api_update(self): self.check('title', 'Echo API 2'), ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicApiPreparer() + @ApicMetadataPreparer() + def test_api_update_with_all_optional_params(self, metadata_name): + self.kwargs.update({ + 'contacts': '[{email:contact@example.com,name:test,url:example.com}]', + 'customProperties': '{{"{}":true}}'.format(metadata_name), + 'externalDocumentation': '[{title:\'onboarding docs\',url:example.com}]', + 'license': '{url:example.com}', + }) + self.cmd('az apic api update -g {rg} -s {s} --api-id {api} --title "test api 2" --type rest --contacts "{contacts}" --custom-properties \'{customProperties}\' --description "API description" --external-documentation "{externalDocumentation}" --license "{license}" --summary "summary"', checks=[ + self.check('kind', 'rest'), + self.check('title', 'test api 2'), + self.check('contacts', [{"email":"contact@example.com","name":"test","url":"example.com"}]), + self.check('customProperties.{}'.format(metadata_name), True), + self.check('description', 'API description'), + self.check('externalDocumentation', [{"title":"onboarding docs","url":"example.com"}]), + self.check('license', {"url":"example.com"}), + self.check('summary', 'summary') + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @ApicApiPreparer() def test_api_delete(self): - self.cmd('az apic api delete -g {rg} -s {s} --api-id {api} --yes') \ No newline at end of file + self.cmd('az apic api delete -g {rg} -s {s} --api-id {api} --yes') + self.cmd('az apic api show -g {rg} -s {s} --api-id {api}', expect_failure=True) \ No newline at end of file diff --git a/src/apic-extension/azext_apic_extension/tests/latest/test_definition_commands.py b/src/apic-extension/azext_apic_extension/tests/latest/test_definition_commands.py index c65a446ce22..d1e2b8f7da8 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/test_definition_commands.py +++ b/src/apic-extension/azext_apic_extension/tests/latest/test_definition_commands.py @@ -10,6 +10,9 @@ from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer from .utils import ApicServicePreparer, ApicApiPreparer, ApicVersionPreparer, ApicDefinitionPreparer +current_dir = os.path.dirname(os.path.realpath(__file__)) +test_assets_dir = os.path.join(current_dir, 'test_assets') + class VersionCommandsTests(ScenarioTest): @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @@ -25,6 +28,20 @@ def test_definition_create(self): self.check('title', 'OpenAPI'), ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicApiPreparer() + @ApicVersionPreparer() + def test_definition_create_with_all_optional_params(self): + self.kwargs.update({ + 'name': self.create_random_name(prefix='cli', length=24) + }) + self.cmd('az apic api definition create -g {rg} -s {s} --api-id {api} --version-id {v} --definition-id {name} --title "OpenAPI" --description "test description"', checks=[ + self.check('name', '{name}'), + self.check('title', 'OpenAPI'), + self.check('description', 'test description'), + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @ApicApiPreparer() @@ -49,15 +66,31 @@ def test_definition_list(self, definition_id1, definition_id2): self.check('[1].name', definition_id2), ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicApiPreparer() + @ApicVersionPreparer() + @ApicDefinitionPreparer(parameter_name="definition_id1") + @ApicDefinitionPreparer(parameter_name="definition_id2") + def test_definition_list_with_all_optional_params(self, definition_id1): + self.kwargs.update({ + 'definition_id': definition_id1 + }) + self.cmd('az apic api definition list -g {rg} -s {s} --api-id {api} --version-id {v} --filter "name eq \'{definition_id}\'"', checks=[ + self.check('length(@)', 1), + self.check('[0].name', definition_id1) + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @ApicApiPreparer() @ApicVersionPreparer() @ApicDefinitionPreparer() def test_definition_update(self): - self.cmd('az apic api definition update -g {rg} -s {s} --api-id {api} --version-id {v} --definition-id {d} --title "Swagger"', checks=[ + self.cmd('az apic api definition update -g {rg} -s {s} --api-id {api} --version-id {v} --definition-id {d} --title "Swagger" --description "test description 2"', checks=[ self.check('name', '{d}'), self.check('title', 'Swagger'), + self.check('description', 'test description 2'), ]) @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @@ -67,6 +100,7 @@ def test_definition_update(self): @ApicDefinitionPreparer() def test_definition_delete(self): self.cmd('az apic api definition delete -g {rg} -s {s} --api-id {api} --version-id {v} --definition-id {d} --yes') + self.cmd('az apic api definition show -g {rg} -s {s} --api-id {api} --version-id {v} --definition-id {d}', expect_failure=True) @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @@ -121,6 +155,34 @@ def test_definition_import_inline(self): imported_content = json.loads(self.kwargs['value']) + assert exported_content == imported_content, "The exported content is not the same as the imported content." + finally: + os.remove(exported_file_path) + + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicApiPreparer() + @ApicVersionPreparer() + @ApicDefinitionPreparer() + def test_definition_import_from_file(self): + self.kwargs.update({ + 'import_filename': os.path.join(test_assets_dir, 'petstore.json'), + 'export_filename': "test_definition_import_from_file.json", + 'specification': '{"name":"openapi","version":"3.0.0"}' + }) + + self.cmd('az apic api definition import-specification -g {rg} -s {s} --api-id {api} --version-id {v} --definition-id {d} --format "inline" --specification \'{specification}\' --value "@{import_filename}"') + + self.cmd('az apic api definition export-specification -g {rg} -s {s} --api-id {api} --version-id {v} --definition-id {d} --file-name {export_filename}') + + try: + exported_file_path = self.kwargs['export_filename'] + with open(exported_file_path, 'r') as file: + exported_content = json.load(file) + + with open(self.kwargs['import_filename'], 'r') as file: + imported_content = json.load(file) + assert exported_content == imported_content, "The exported content is not the same as the imported content." finally: os.remove(exported_file_path) \ No newline at end of file diff --git a/src/apic-extension/azext_apic_extension/tests/latest/test_deployment_commands.py b/src/apic-extension/azext_apic_extension/tests/latest/test_deployment_commands.py index 493ad07dc6f..e2256abc265 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/test_deployment_commands.py +++ b/src/apic-extension/azext_apic_extension/tests/latest/test_deployment_commands.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from .utils import ApicServicePreparer, ApicApiPreparer, ApicVersionPreparer, ApicDefinitionPreparer, ApicEnvironmentPreparer, ApicDeploymentPreparer +from .utils import ApicServicePreparer, ApicApiPreparer, ApicVersionPreparer, ApicDefinitionPreparer, ApicEnvironmentPreparer, ApicDeploymentPreparer, ApicMetadataPreparer class DeploymentCommandsTests(ScenarioTest): @@ -28,6 +28,31 @@ def test_deployment_create(self): self.check('environmentId', '/workspaces/default/environments/{e}'), ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicEnvironmentPreparer() + @ApicApiPreparer() + @ApicVersionPreparer() + @ApicDefinitionPreparer() + @ApicMetadataPreparer() + def test_deployment_create_with_all_optional_params(self, metadata_name): + self.kwargs.update({ + 'name': self.create_random_name(prefix='cli', length=24), + 'server': '{"runtimeUri":["https://example.com"]}', + 'customProperties': '{{"{}":true}}'.format(metadata_name), + }) + self.cmd('az apic api deployment create -g {rg} -s {s} --api-id {api} --definition-id /workspaces/default/apis/{api}/versions/{v}/definitions/{d} --environment-id /workspaces/default/environments/{e} --deployment-id {name} --title "test deployment" --server \'{server}\' --description "deployment description" --state active --custom-properties \'{customProperties}\'', checks=[ + self.check('name', '{name}'), + self.check('title', 'test deployment'), + self.check('server.runtimeUri[0]', 'https://example.com'), + self.check('customProperties.{}'.format(metadata_name), True), + self.check('definitionId', '/workspaces/default/apis/{api}/versions/{v}/definitions/{d}'), + self.check('environmentId', '/workspaces/default/environments/{e}'), + self.check('description', 'deployment description'), + # TODO: Uncomment this line after Control Plane API fixed related bug + # self.check('state', 'active'), + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @ApicEnvironmentPreparer() @@ -60,6 +85,23 @@ def test_deployment_list(self, deployment_id1, deployment_id2): self.check('[1].name', deployment_id2), ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicEnvironmentPreparer() + @ApicApiPreparer() + @ApicVersionPreparer() + @ApicDefinitionPreparer() + @ApicDeploymentPreparer(parameter_name='deployment_id1') + @ApicDeploymentPreparer(parameter_name='deployment_id2') + def test_deployment_list_with_all_optional_params(self, deployment_id1): + self.kwargs.update({ + 'deployment_id': deployment_id1 + }) + self.cmd('az apic api deployment list -g {rg} -s {s} --api-id {api} --filter "name eq \'{deployment_id}\'"', checks=[ + self.check('length(@)', 1), + self.check('[0].name', deployment_id1) + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @ApicEnvironmentPreparer() @@ -72,6 +114,30 @@ def test_deployment_update(self): self.check('title', 'updated deployment'), ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicEnvironmentPreparer() + @ApicApiPreparer() + @ApicVersionPreparer() + @ApicDefinitionPreparer() + @ApicDeploymentPreparer() + @ApicMetadataPreparer() + def test_deployment_update_with_all_optional_params(self, metadata_name): + self.kwargs.update({ + 'server': '{"runtimeUri":["https://example2.com"]}', + 'customProperties': '{{"{}":true}}'.format(metadata_name), + }) + self.cmd('az apic api deployment update -g {rg} -s {s} --api-id {api} --definition-id /workspaces/default/apis/{api}/versions/{v}/definitions/{d} --environment-id /workspaces/default/environments/{e} --deployment-id {dep} --title "updated deployment" --server \'{server}\' --description "deployment description" --state active --custom-properties \'{customProperties}\'', checks=[ + self.check('title', 'updated deployment'), + self.check('server.runtimeUri[0]', 'https://example2.com'), + self.check('customProperties.{}'.format(metadata_name), True), + self.check('definitionId', '/workspaces/default/apis/{api}/versions/{v}/definitions/{d}'), + self.check('environmentId', '/workspaces/default/environments/{e}'), + self.check('description', 'deployment description'), + # TODO: Uncomment this line after Control Plane API fixed related bug + # self.check('state', 'active'), + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @ApicEnvironmentPreparer() diff --git a/src/apic-extension/azext_apic_extension/tests/latest/test_environment_commands.py b/src/apic-extension/azext_apic_extension/tests/latest/test_environment_commands.py index 2d775970887..cad9173e32a 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/test_environment_commands.py +++ b/src/apic-extension/azext_apic_extension/tests/latest/test_environment_commands.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from .utils import ApicServicePreparer, ApicEnvironmentPreparer +from .utils import ApicServicePreparer, ApicEnvironmentPreparer, ApicMetadataPreparer class EnvironmentCommandsTests(ScenarioTest): @@ -21,6 +21,29 @@ def test_environment_create(self): self.check('customProperties', '{{}}') ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicMetadataPreparer() + def test_environment_create_with_all_optional_params(self, metadata_name): + self.kwargs.update({ + 'name': self.create_random_name(prefix='cli', length=24), + 'custom_properties': '{{"{}":true}}'.format(metadata_name), + 'onboarding': "{developerPortalUri:['https://developer.contoso.com'],instructions:'instructions markdown'}", + 'server': "{type:'Azure API Management',managementPortalUri:['example.com']}" + }) + self.cmd('az apic environment create -g {rg} -s {s} --environment-id {name} --title "test environment" --type testing --custom-properties \'{custom_properties}\' --description "environment description" --onboarding "{onboarding}" --server "{server}"', checks=[ + self.check('customProperties.{}'.format(metadata_name), True), + self.check('description', 'environment description'), + self.check('kind', 'testing'), + self.check('name', '{name}'), + self.check('onboarding.developerPortalUri[0]', 'https://developer.contoso.com'), + self.check('onboarding.instructions', 'instructions markdown'), + self.check('server.managementPortalUri[0]', 'example.com'), + self.check('server.type', 'Azure API Management'), + self.check('title', 'test environment'), + self.check('type', 'Microsoft.ApiCenter/services/workspaces/environments') + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @ApicEnvironmentPreparer() @@ -43,6 +66,19 @@ def test_environment_list(self, environment_name1, environment_name2): self.check('@[1].name', environment_name2) ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicEnvironmentPreparer(parameter_name='environment_name1') + @ApicEnvironmentPreparer(parameter_name='environment_name2') + def test_environment_list_with_all_optional_params(self, environment_name1): + self.kwargs.update({ + 'environment_name': environment_name1 + }) + self.cmd('az apic environment list -g {rg} -s {s} --filter "name eq \'{environment_name}\'"', checks=[ + self.check('length(@)', 1), + self.check('@[0].name', environment_name1) + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @ApicEnvironmentPreparer() @@ -51,8 +87,30 @@ def test_environment_update(self): self.check('title', 'test environment 2') ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicMetadataPreparer() + @ApicEnvironmentPreparer() + def test_environment_update_with_all_optional_params(self, metadata_name): + self.kwargs.update({ + 'custom_properties': '{{"{}":true}}'.format(metadata_name), + 'onboarding': "{developerPortalUri:['https://developer.contoso.com'],instructions:'instructions markdown'}", + 'server': "{type:'Azure API Management',managementPortalUri:['example.com']}" + }) + self.cmd('az apic environment update -g {rg} -s {s} --environment-id {e} --title "test environment 2" --type testing --custom-properties \'{custom_properties}\' --description "environment description" --onboarding "{onboarding}" --server "{server}"', checks=[ + self.check('customProperties.{}'.format(metadata_name), True), + self.check('description', 'environment description'), + self.check('kind', 'testing'), + self.check('onboarding.developerPortalUri[0]', 'https://developer.contoso.com'), + self.check('onboarding.instructions', 'instructions markdown'), + self.check('server.managementPortalUri[0]', 'example.com'), + self.check('server.type', 'Azure API Management'), + self.check('title', 'test environment 2'), + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @ApicEnvironmentPreparer() def test_environment_delete(self): - self.cmd('az apic environment delete -g {rg} -s {s} --environment-id {e} --yes') \ No newline at end of file + self.cmd('az apic environment delete -g {rg} -s {s} --environment-id {e} --yes') + self.cmd('az apic environment show -g {rg} -s {s} --environment-id {e}', expect_failure=True) \ No newline at end of file diff --git a/src/apic-extension/azext_apic_extension/tests/latest/test_metadata_commands.py b/src/apic-extension/azext_apic_extension/tests/latest/test_metadata_commands.py index 8f0894b7fbd..a909075f7dc 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/test_metadata_commands.py +++ b/src/apic-extension/azext_apic_extension/tests/latest/test_metadata_commands.py @@ -49,6 +49,19 @@ def test_metadata_list(self, metadata_name1, metadata_name2): self.check('@[0].name', metadata_name1), self.check('@[1].name', metadata_name2) ]) + + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicMetadataPreparer(parameter_name='metadata_name1') + @ApicMetadataPreparer(parameter_name='metadata_name2') + def test_metadata_list_with_all_optional_params(self, metadata_name1): + self.kwargs.update({ + 'metadata_name': metadata_name1 + }) + self.cmd('az apic metadata list -g {rg} -s {s} --filter "name eq \'{metadata_name}\'"', checks=[ + self.check('length(@)', 1), + self.check('@[0].name', metadata_name1), + ]) @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @@ -67,6 +80,7 @@ def test_metadata_update(self): @ApicMetadataPreparer() def test_metadata_delete(self): self.cmd('az apic metadata delete -g {rg} -s {s} --name {m} --yes') + self.cmd('az apic metadata show -g {rg} -s {s} --name {m}', expect_failure=True) @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() diff --git a/src/apic-extension/azext_apic_extension/tests/latest/test_service_commands.py b/src/apic-extension/azext_apic_extension/tests/latest/test_service_commands.py index 058f4bc4fde..9bee63f8f11 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/test_service_commands.py +++ b/src/apic-extension/azext_apic_extension/tests/latest/test_service_commands.py @@ -20,6 +20,20 @@ def test_create_service(self, resource_group): self.check('name', '{name}'), self.check('resourceGroup', '{rg}') ]) + + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + def test_create_service_with_all_optional_params(self, resource_group): + self.kwargs.update({ + 'name': self.create_random_name(prefix='cli', length=24), + 'rg': resource_group + }) + self.cmd('az apic service create -g {rg} --name {name} --location westeurope --tags \'{{test:value}}\' --identity \'{{type:SystemAssigned}}\'', checks=[ + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('identity.type', 'SystemAssigned'), + self.check('location', 'westeurope'), + self.check('tags.test', 'value') + ]) @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @@ -29,6 +43,25 @@ def test_show_service(self): self.check('resourceGroup', '{rg}') ]) + @unittest.skip('The Control Plane API has bug') + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer(parameter_name='service_name1') + @ApicServicePreparer(parameter_name='service_name2') + def test_list_service(self, service_name1, service_name2): + self.cmd('az apic service list', checks=[ + self.check('length(@)', 2), + self.check('@[0].name', service_name1), + self.check('@[1].name', service_name2) + ]) + + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + def test_list_service_in_rg(self, service_name): + self.cmd('az apic service list -g {rg}', checks=[ + self.check('length(@)', 1), + self.check('@[0].name', service_name) + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() def test_update_service(self): @@ -36,10 +69,19 @@ def test_update_service(self): self.check('tags.test', 'value') ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + def test_update_service_with_all_optional_params(self): + self.cmd('az apic service update -g {rg} -s {s} --tags "{{test:value}}" --identity "{{type:SystemAssigned}}"', checks=[ + self.check('tags.test', 'value'), + self.check('identity.type', 'SystemAssigned') + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() def test_delete_service(self): - self.cmd('az apic service delete -g {rg} -s {s}a --yes') + self.cmd('az apic service delete -g {rg} -s {s} --yes') + self.cmd('az apic service show -g {rg} -s {s}', expect_failure=True) @unittest.skip('The Control Plane API has bug') @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @@ -59,4 +101,28 @@ def test_import_from_apim(self, identity_id): self.cmd('az role assignment create --role "API Management Service Reader Role" --assignee-object-id {identity_id} --assignee-principal-type ServicePrincipal --scope {apim_id}') self.cmd('az apic service import-from-apim -g {rg} --service-name {s} --source-resource-ids {apim_id}/apis/*') - # TODO: check result \ No newline at end of file + # TODO: check result + + @unittest.skip('The Control Plane API has bug') + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer(enable_system_assigned_identity=True) + def test_import_from_apim_for_one_api(self, identity_id): + self.kwargs.update({ + 'apim_name': self.create_random_name(prefix='cli', length=24), + 'identity_id': identity_id + }) + apim_service = self.cmd('az apim create -g {rg} --name {apim_name} --publisher-name test --publisher-email test@example.com --sku-name Consumption').get_output_in_json() + # Add echo api + self.cmd('az apim api create -g {rg} --service-name {apim_name} --api-id echo --display-name "Echo API" --path "/echo"') + self.cmd('az apim api operation create -g {rg} --service-name {apim_name} --api-id echo --url-template "/echo" --method "GET" --display-name "GetOperation"') + # Add foo api + self.cmd('az apim api create -g {rg} --service-name {apim_name} --api-id foo --display-name "Foo API" --path "/foo"') + self.cmd('az apim api operation create -g {rg} --service-name {apim_name} --api-id foo --url-template "/foo" --method "GET" --display-name "GetOperation"') + apim_id = apim_service['id'] + self.kwargs.update({ + 'apim_id': apim_id + }) + self.cmd('az role assignment create --role "API Management Service Reader Role" --assignee-object-id {identity_id} --assignee-principal-type ServicePrincipal --scope {apim_id}') + self.cmd('az apic service import-from-apim -g {rg} --service-name {s} --source-resource-ids {apim_id}/apis/echo') + + # TODO: check result diff --git a/src/apic-extension/azext_apic_extension/tests/latest/test_version_commands.py b/src/apic-extension/azext_apic_extension/tests/latest/test_version_commands.py index 6eb7d5af547..6d03e3651c5 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/test_version_commands.py +++ b/src/apic-extension/azext_apic_extension/tests/latest/test_version_commands.py @@ -44,13 +44,28 @@ def test_version_list(self, version_id1, version_id2): self.check('@[1].name', version_id2) ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) + @ApicServicePreparer() + @ApicApiPreparer() + @ApicVersionPreparer(parameter_name='version_id1') + @ApicVersionPreparer(parameter_name='version_id2') + def test_version_list_with_all_optional_params(self, version_id1): + self.kwargs.update({ + 'version_id': version_id1 + }) + self.cmd('az apic api version list -g {rg} -s {s} --api-id {api} --filter "name eq \'{version_id}\'"', checks=[ + self.check('length(@)', 1), + self.check('@[0].name', version_id1) + ]) + @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @ApicServicePreparer() @ApicApiPreparer() @ApicVersionPreparer() def test_version_update(self): - self.cmd('az apic api version update -g {rg} -s {s} --api-id {api} --version-id {v} --title "v1.0.1"', checks=[ + self.cmd('az apic api version update -g {rg} -s {s} --api-id {api} --version-id {v} --title "v1.0.1" --lifecycle-stage development', checks=[ self.check('title', 'v1.0.1'), + self.check('lifecycleStage', 'development'), ]) @ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32) @@ -58,4 +73,5 @@ def test_version_update(self): @ApicApiPreparer() @ApicVersionPreparer() def test_version_delete(self): - self.cmd('az apic api version delete -g {rg} -s {s} --api-id {api} --version-id {v} --yes') \ No newline at end of file + self.cmd('az apic api version delete -g {rg} -s {s} --api-id {api} --version-id {v} --yes') + self.cmd('az apic api version show -g {rg} -s {s} --api-id {api} --version-id {v}', expect_failure=True) \ No newline at end of file diff --git a/src/apic-extension/azext_apic_extension/tests/latest/utils.py b/src/apic-extension/azext_apic_extension/tests/latest/utils.py index 92a8851b158..e4c17c9483a 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/utils.py +++ b/src/apic-extension/azext_apic_extension/tests/latest/utils.py @@ -53,7 +53,7 @@ def __init__(self, name_prefix='clitest', length=24, parameter_name='metadata_name', resource_group_parameter_name='resource_group', apic_service_parameter_name='service_name', schema='{"type":"boolean", "title":"Public Facing"}', - assignments='[{entity:api,required:true,deprecated:false}]', + assignments='[{entity:api,required:true,deprecated:false},{entity:environment,required:true,deprecated:false},{entity:deployment,required:true,deprecated:false}]', key='m'): super(ApicMetadataPreparer, self).__init__(name_prefix, length) self.cli_ctx = get_dummy_cli()