diff --git a/src/apic-extension/azext_apic_extension/_help.py b/src/apic-extension/azext_apic_extension/_help.py index e57c940f8f0..cb8148a40cf 100644 --- a/src/apic-extension/azext_apic_extension/_help.py +++ b/src/apic-extension/azext_apic_extension/_help.py @@ -31,4 +31,8 @@ text: | az apic api register -g api-center-test -n contosoeuap --api-location "examples/cli-examples/spec-examples/openai.json" --environment-id public az apic api register -g api-center-test -n contosoeuap --api-location "examples/cli-examples/spec-examples/openai.yml" --environment-id public + - name: Register api by providing spec url. + text: | + az apic api register -g api-center-test -n contosoeuap --api-location "https://petstore.swagger.io/v2/swagger.json" --environment-id public + az apic api register -g api-center-test -n contosoeuap --api-location "https://petstore.swagger.io/v2/swagger.yaml" --environment-id public """ diff --git a/src/apic-extension/azext_apic_extension/custom.py b/src/apic-extension/azext_apic_extension/custom.py index bbc65d3bd93..28346b2c221 100644 --- a/src/apic-extension/azext_apic_extension/custom.py +++ b/src/apic-extension/azext_apic_extension/custom.py @@ -23,6 +23,8 @@ from .command_patches import ExportAPIDefinitionExtension from .command_patches import ExportMetadataExtension +from azure.cli.core.azclierror import InvalidArgumentValueError + logger = get_logger(__name__) @@ -162,26 +164,53 @@ def register_apic(cmd, api_location, resource_group, service_name, environment_i # Load the JSON file if api_location: - # TODO Future Confirm its a file and not link - with open(str(api_location), 'rb') as f: - rawdata = f.read() - result = chardet.detect(rawdata) - encoding = result['encoding'] - - # TODO - read other file types later value = None - if str(api_location).endswith('.yaml') or str(api_location).endswith('.yml'): - with open(str(api_location), 'r', encoding=encoding) as f: - content = f.read() - data = yaml.safe_load(content) - if data: - value = content - if (str(api_location).endswith('.json')): - with open(str(api_location), 'r', encoding=encoding) as f: - content = f.read() - data = json.loads(content) - if data: - value = content + custom_format = 'inline' + # Read the spec content from URL + if str(api_location).startswith('https://') or str(api_location).startswith('http://'): + try: + # Fetch the content from the URL + response = requests.get(api_location) + # Raise an error for bad status codes + response.raise_for_status() + # Try to parse the content as JSON + try: + data = json.loads(response.content) + except json.JSONDecodeError: + try: + # If JSON parsing fails, try to parse as YAML + data = yaml.safe_load(response.content) + except yaml.YAMLError as e: + data = None + value = None + raise InvalidArgumentValueError(error_msg=f"Error parsing data from {api_location}: {e}") + # sys.exit(-1) + # If we could parse the content(json or yaml), set format to link + value = str(api_location) if data else None + custom_format = 'link' if data else 'inline' + except requests.exceptions.RequestException as e: + data = None + value = None + raise InvalidArgumentValueError(error_msg=f"Error fetching data from invalid url {api_location}: {e}") + # sys.exit(-1) + else: + # Confirm its a file and not link + with open(str(api_location), 'rb') as f: + rawdata = f.read() + result = chardet.detect(rawdata) + encoding = result['encoding'] + + # TODO - read other file types later + if str(api_location).endswith('.yaml') or str(api_location).endswith('.yml'): + with open(str(api_location), 'r', encoding=encoding) as f: + content = f.read() + data = yaml.safe_load(content) + value = content if data else None + if (str(api_location).endswith('.json')): + with open(str(api_location), 'r', encoding=encoding) as f: + content = f.read() + data = json.loads(content) + value = content if data else None # If we could not read the file, return error if value is None: @@ -315,7 +344,7 @@ def register_apic(cmd, api_location, resource_group, service_name, environment_i 'api_id': extracted_api_name, 'version_id': extracted_api_version, 'definition_id': extracted_definition_name, - 'format': 'inline', + 'format': custom_format, 'specification': specification_details, # TODO write the correct spec object 'value': value } diff --git a/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_register_using_spec_url_with_invalid_content.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_register_using_spec_url_with_invalid_content.yaml new file mode 100644 index 00000000000..060e8603a23 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_register_using_spec_url_with_invalid_content.yaml @@ -0,0 +1,154 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.3 + method: GET + uri: https://github.com/ + response: + body: + string: '!!! The response body has been omitted from the recording because it + is larger than 128 KB. It will be replaced with blank content of 254684 bytes + while replay. 254684' + headers: + accept-ranges: + - bytes + cache-control: + - max-age=0, private, must-revalidate + content-language: + - en-US + content-length: + - '181' + content-security-policy: + - 'default-src ''none''; base-uri ''self''; child-src github.com/assets-cdn/worker/ + github.com/webpack/ github.com/assets/ gist.github.com/assets-cdn/worker/; + connect-src ''self'' uploads.github.com www.githubstatus.com collector.github.com + raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com + github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com + *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com + objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com + proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com + wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ + productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ + productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ + productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ + productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ + productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ + productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ + productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ + productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ + productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ + productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com + github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com + wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com + api.business.githubcopilot.com api.enterprise.githubcopilot.com github.githubassets.com + edge.fullstory.com rs.fullstory.com; font-src github.githubassets.com; form-action + ''self'' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; + frame-ancestors ''none''; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com + www.youtube-nocookie.com; img-src ''self'' data: blob: github.githubassets.com + media.githubusercontent.com camo.githubusercontent.com identicons.github.com + avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com + objects.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ + private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com + customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com + *.githubusercontent.com; manifest-src ''self''; media-src github.com user-images.githubusercontent.com/ + secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com + github-production-user-asset-6210df.s3.amazonaws.com gist.github.com github.githubassets.com; + script-src github.githubassets.com; style-src ''unsafe-inline'' github.githubassets.com; + upgrade-insecure-requests; worker-src github.com/assets-cdn/worker/ github.com/webpack/ + github.com/assets/ gist.github.com/assets-cdn/worker/' + content-type: + - text/html; charset=utf-8 + date: + - Tue, 15 Oct 2024 04:01:12 GMT + etag: + - W/"2a20e14cbb76e542f3c5fed75a897deb" + referrer-policy: + - origin-when-cross-origin, strict-origin-when-cross-origin + server: + - GitHub.com + set-cookie: + - _gh_sess=nDe4UkSl89r%2BcpkpALiHWruZQSCE0K7Fv4fZdUJ16N4E1RiBG7xxX7sfwTTFgEBKMq3qRcEnxXvS3tZOl5yHbg1o2Uda3WqjBs4TNl7cYJI7F6QT5eyX%2FtSiHQYzoxuAyhq5e%2F%2Bouf17OSFst%2FoFYupJtDycyzraeIzFF7CY6%2FLMz8AvqcXpf%2FQBM2C0pU%2FZQDG%2F9pdSzk6xumiDwggGAJ1WhMgHSE%2FPWlQIQoPfh%2FF%2FOwIOs7NWfq6d5zkw0tcAbzNO%2Fo5x1oL1C7EY88z2%2Bg%3D%3D--DX1tQfpx6VemsBsP--fkxfh8oqGwFOgJFUsVzA5Q%3D%3D; + Path=/; HttpOnly; Secure; SameSite=Lax + - _octo=GH1.1.1313912529.1728964875; Path=/; Domain=github.com; Expires=Wed, + 15 Oct 2025 04:01:15 GMT; Secure; SameSite=Lax + - logged_in=no; Path=/; Domain=github.com; Expires=Wed, 15 Oct 2025 04:01:15 + GMT; HttpOnly; Secure; SameSite=Lax + strict-transport-security: + - max-age=31536000; includeSubdomains; preload + transfer-encoding: + - chunked + vary: + - X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Language, Accept-Encoding, + Accept, X-Requested-With + x-content-type-options: + - nosniff + x-frame-options: + - deny + x-github-request-id: + - 0806:21A5DE:29131BD:2D8EF81:670DE90B + x-xss-protection: + - '0' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api show + Connection: + - keep-alive + ParameterSetName: + - -g -n --api-id + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore?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: + - Tue, 15 Oct 2024 04:01:16 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-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: F157DB4EBD6E442D94239BD1D1EBFE1A Ref B: MAA201060513023 Ref C: 2024-10-15T04:01:15Z' + 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_register_with_invalid_spec_url.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_register_with_invalid_spec_url.yaml new file mode 100644 index 00000000000..b090d6475a6 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_register_with_invalid_spec_url.yaml @@ -0,0 +1,109 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.3 + method: GET + uri: https://github.com/invalidrepo + response: + body: + string: Not Found + headers: + cache-control: + - no-cache + content-length: + - '9' + content-security-policy: + - default-src 'none'; base-uri 'self'; connect-src 'self'; form-action 'self'; + img-src 'self' data:; script-src 'self'; style-src 'unsafe-inline' + content-type: + - text/plain; charset=utf-8 + date: + - Tue, 15 Oct 2024 04:01:14 GMT + referrer-policy: + - origin-when-cross-origin, strict-origin-when-cross-origin + server: + - GitHub.com + set-cookie: + - _gh_sess=05a6i77a0k6QZ7mJnH%2BnWIliR5guipRh0Z%2Fs73RhXbNuLqVAnKu19dDhM1kWOhpwMFe8ZSuBFfzUJOop9ta9yqM6ZL3qs0chytbmyaEh%2F6YELXvhhcXHO1za3tMCbJBynfJ2HGeIRPC1GyepCLgKnyg13K1gRKMbFbxNTUgqERu59BrD%2FNGDDp1bdz4EYNrl5THCBqSX8Ozp%2Foi1ZKPOaJK0LujquBpWJqd7CQ09E9EUxeIqUSeKPPrUv4S41%2B8B9pLJDrHign95vSXBE48xMQ%3D%3D--N%2F4dD85JrQ2c5oY5--X7gxxV%2Bs35GOWsptYdJVPw%3D%3D; + Path=/; HttpOnly; Secure; SameSite=Lax + - _octo=GH1.1.98402674.1728964874; Path=/; Domain=github.com; Expires=Wed, 15 + Oct 2025 04:01:14 GMT; Secure; SameSite=Lax + - logged_in=no; Path=/; Domain=github.com; Expires=Wed, 15 Oct 2025 04:01:14 + GMT; HttpOnly; Secure; SameSite=Lax + strict-transport-security: + - max-age=31536000; includeSubdomains; preload + vary: + - X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, Accept-Encoding, Accept, + X-Requested-With + x-content-type-options: + - nosniff + x-frame-options: + - deny + x-github-request-id: + - 6596:211F6C:2906DAC:2D82A98:670DE90A + x-xss-protection: + - '0' + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api show + Connection: + - keep-alive + ParameterSetName: + - -g -n --api-id + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore?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: + - Tue, 15 Oct 2024 04:01:15 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-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: F3CFA1D4358D4160A2BCF0E69AEE0789 Ref B: MAA201060515025 Ref C: 2024-10-15T04:01:14Z' + 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_register_with_json_spec_from_url.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_register_with_json_spec_from_url.yaml new file mode 100644 index 00000000000..ea808eb6fef --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_register_with_json_spec_from_url.yaml @@ -0,0 +1,666 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.3 + method: GET + uri: https://petstore.swagger.io/v2/swagger.json + response: + body: + string: '{"swagger":"2.0","info":{"description":"This is a sample server Petstore + server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) + or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, + you can use the api key `special-key` to test the authorization filters.","version":"1.0.7","title":"Swagger + Petstore","termsOfService":"http://swagger.io/terms/","contact":{"email":"apiteam@swagger.io"},"license":{"name":"Apache + 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"host":"petstore.swagger.io","basePath":"/v2","tags":[{"name":"pet","description":"Everything + about your Pets","externalDocs":{"description":"Find out more","url":"http://swagger.io"}},{"name":"store","description":"Access + to Petstore orders"},{"name":"user","description":"Operations about user","externalDocs":{"description":"Find + out more about our store","url":"http://swagger.io"}}],"schemes":["https","http"],"paths":{"/pet/{petId}/uploadImage":{"post":{"tags":["pet"],"summary":"uploads + an image","description":"","operationId":"uploadFile","consumes":["multipart/form-data"],"produces":["application/json"],"parameters":[{"name":"petId","in":"path","description":"ID + of pet to update","required":true,"type":"integer","format":"int64"},{"name":"additionalMetadata","in":"formData","description":"Additional + data to pass to server","required":false,"type":"string"},{"name":"file","in":"formData","description":"file + to upload","required":false,"type":"file"}],"responses":{"200":{"description":"successful + operation","schema":{"$ref":"#/definitions/ApiResponse"}}},"security":[{"petstore_auth":["write:pets","read:pets"]}]}},"/pet":{"post":{"tags":["pet"],"summary":"Add + a new pet to the store","description":"","operationId":"addPet","consumes":["application/json","application/xml"],"produces":["application/json","application/xml"],"parameters":[{"in":"body","name":"body","description":"Pet + object that needs to be added to the store","required":true,"schema":{"$ref":"#/definitions/Pet"}}],"responses":{"405":{"description":"Invalid + input"}},"security":[{"petstore_auth":["write:pets","read:pets"]}]},"put":{"tags":["pet"],"summary":"Update + an existing pet","description":"","operationId":"updatePet","consumes":["application/json","application/xml"],"produces":["application/json","application/xml"],"parameters":[{"in":"body","name":"body","description":"Pet + object that needs to be added to the store","required":true,"schema":{"$ref":"#/definitions/Pet"}}],"responses":{"400":{"description":"Invalid + ID supplied"},"404":{"description":"Pet not found"},"405":{"description":"Validation + exception"}},"security":[{"petstore_auth":["write:pets","read:pets"]}]}},"/pet/findByStatus":{"get":{"tags":["pet"],"summary":"Finds + Pets by status","description":"Multiple status values can be provided with + comma separated strings","operationId":"findPetsByStatus","produces":["application/json","application/xml"],"parameters":[{"name":"status","in":"query","description":"Status + values that need to be considered for filter","required":true,"type":"array","items":{"type":"string","enum":["available","pending","sold"],"default":"available"},"collectionFormat":"multi"}],"responses":{"200":{"description":"successful + operation","schema":{"type":"array","items":{"$ref":"#/definitions/Pet"}}},"400":{"description":"Invalid + status value"}},"security":[{"petstore_auth":["write:pets","read:pets"]}]}},"/pet/findByTags":{"get":{"tags":["pet"],"summary":"Finds + Pets by tags","description":"Multiple tags can be provided with comma separated + strings. Use tag1, tag2, tag3 for testing.","operationId":"findPetsByTags","produces":["application/json","application/xml"],"parameters":[{"name":"tags","in":"query","description":"Tags + to filter by","required":true,"type":"array","items":{"type":"string"},"collectionFormat":"multi"}],"responses":{"200":{"description":"successful + operation","schema":{"type":"array","items":{"$ref":"#/definitions/Pet"}}},"400":{"description":"Invalid + tag value"}},"security":[{"petstore_auth":["write:pets","read:pets"]}],"deprecated":true}},"/pet/{petId}":{"get":{"tags":["pet"],"summary":"Find + pet by ID","description":"Returns a single pet","operationId":"getPetById","produces":["application/json","application/xml"],"parameters":[{"name":"petId","in":"path","description":"ID + of pet to return","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"successful + operation","schema":{"$ref":"#/definitions/Pet"}},"400":{"description":"Invalid + ID supplied"},"404":{"description":"Pet not found"}},"security":[{"api_key":[]}]},"post":{"tags":["pet"],"summary":"Updates + a pet in the store with form data","description":"","operationId":"updatePetWithForm","consumes":["application/x-www-form-urlencoded"],"produces":["application/json","application/xml"],"parameters":[{"name":"petId","in":"path","description":"ID + of pet that needs to be updated","required":true,"type":"integer","format":"int64"},{"name":"name","in":"formData","description":"Updated + name of the pet","required":false,"type":"string"},{"name":"status","in":"formData","description":"Updated + status of the pet","required":false,"type":"string"}],"responses":{"405":{"description":"Invalid + input"}},"security":[{"petstore_auth":["write:pets","read:pets"]}]},"delete":{"tags":["pet"],"summary":"Deletes + a pet","description":"","operationId":"deletePet","produces":["application/json","application/xml"],"parameters":[{"name":"api_key","in":"header","required":false,"type":"string"},{"name":"petId","in":"path","description":"Pet + id to delete","required":true,"type":"integer","format":"int64"}],"responses":{"400":{"description":"Invalid + ID supplied"},"404":{"description":"Pet not found"}},"security":[{"petstore_auth":["write:pets","read:pets"]}]}},"/store/inventory":{"get":{"tags":["store"],"summary":"Returns + pet inventories by status","description":"Returns a map of status codes to + quantities","operationId":"getInventory","produces":["application/json"],"parameters":[],"responses":{"200":{"description":"successful + operation","schema":{"type":"object","additionalProperties":{"type":"integer","format":"int32"}}}},"security":[{"api_key":[]}]}},"/store/order":{"post":{"tags":["store"],"summary":"Place + an order for a pet","description":"","operationId":"placeOrder","consumes":["application/json"],"produces":["application/json","application/xml"],"parameters":[{"in":"body","name":"body","description":"order + placed for purchasing the pet","required":true,"schema":{"$ref":"#/definitions/Order"}}],"responses":{"200":{"description":"successful + operation","schema":{"$ref":"#/definitions/Order"}},"400":{"description":"Invalid + Order"}}}},"/store/order/{orderId}":{"get":{"tags":["store"],"summary":"Find + purchase order by ID","description":"For valid response try integer IDs with + value >= 1 and <= 10. Other values will generated exceptions","operationId":"getOrderById","produces":["application/json","application/xml"],"parameters":[{"name":"orderId","in":"path","description":"ID + of pet that needs to be fetched","required":true,"type":"integer","maximum":10,"minimum":1,"format":"int64"}],"responses":{"200":{"description":"successful + operation","schema":{"$ref":"#/definitions/Order"}},"400":{"description":"Invalid + ID supplied"},"404":{"description":"Order not found"}}},"delete":{"tags":["store"],"summary":"Delete + purchase order by ID","description":"For valid response try integer IDs with + positive integer value. Negative or non-integer values will generate API errors","operationId":"deleteOrder","produces":["application/json","application/xml"],"parameters":[{"name":"orderId","in":"path","description":"ID + of the order that needs to be deleted","required":true,"type":"integer","minimum":1,"format":"int64"}],"responses":{"400":{"description":"Invalid + ID supplied"},"404":{"description":"Order not found"}}}},"/user/createWithList":{"post":{"tags":["user"],"summary":"Creates + list of users with given input array","description":"","operationId":"createUsersWithListInput","consumes":["application/json"],"produces":["application/json","application/xml"],"parameters":[{"in":"body","name":"body","description":"List + of user object","required":true,"schema":{"type":"array","items":{"$ref":"#/definitions/User"}}}],"responses":{"default":{"description":"successful + operation"}}}},"/user/{username}":{"get":{"tags":["user"],"summary":"Get user + by user name","description":"","operationId":"getUserByName","produces":["application/json","application/xml"],"parameters":[{"name":"username","in":"path","description":"The + name that needs to be fetched. Use user1 for testing. ","required":true,"type":"string"}],"responses":{"200":{"description":"successful + operation","schema":{"$ref":"#/definitions/User"}},"400":{"description":"Invalid + username supplied"},"404":{"description":"User not found"}}},"put":{"tags":["user"],"summary":"Updated + user","description":"This can only be done by the logged in user.","operationId":"updateUser","consumes":["application/json"],"produces":["application/json","application/xml"],"parameters":[{"name":"username","in":"path","description":"name + that need to be updated","required":true,"type":"string"},{"in":"body","name":"body","description":"Updated + user object","required":true,"schema":{"$ref":"#/definitions/User"}}],"responses":{"400":{"description":"Invalid + user supplied"},"404":{"description":"User not found"}}},"delete":{"tags":["user"],"summary":"Delete + user","description":"This can only be done by the logged in user.","operationId":"deleteUser","produces":["application/json","application/xml"],"parameters":[{"name":"username","in":"path","description":"The + name that needs to be deleted","required":true,"type":"string"}],"responses":{"400":{"description":"Invalid + username supplied"},"404":{"description":"User not found"}}}},"/user/login":{"get":{"tags":["user"],"summary":"Logs + user into the system","description":"","operationId":"loginUser","produces":["application/json","application/xml"],"parameters":[{"name":"username","in":"query","description":"The + user name for login","required":true,"type":"string"},{"name":"password","in":"query","description":"The + password for login in clear text","required":true,"type":"string"}],"responses":{"200":{"description":"successful + operation","headers":{"X-Expires-After":{"type":"string","format":"date-time","description":"date + in UTC when token expires"},"X-Rate-Limit":{"type":"integer","format":"int32","description":"calls + per hour allowed by the user"}},"schema":{"type":"string"}},"400":{"description":"Invalid + username/password supplied"}}}},"/user/logout":{"get":{"tags":["user"],"summary":"Logs + out current logged in user session","description":"","operationId":"logoutUser","produces":["application/json","application/xml"],"parameters":[],"responses":{"default":{"description":"successful + operation"}}}},"/user/createWithArray":{"post":{"tags":["user"],"summary":"Creates + list of users with given input array","description":"","operationId":"createUsersWithArrayInput","consumes":["application/json"],"produces":["application/json","application/xml"],"parameters":[{"in":"body","name":"body","description":"List + of user object","required":true,"schema":{"type":"array","items":{"$ref":"#/definitions/User"}}}],"responses":{"default":{"description":"successful + operation"}}}},"/user":{"post":{"tags":["user"],"summary":"Create user","description":"This + can only be done by the logged in user.","operationId":"createUser","consumes":["application/json"],"produces":["application/json","application/xml"],"parameters":[{"in":"body","name":"body","description":"Created + user object","required":true,"schema":{"$ref":"#/definitions/User"}}],"responses":{"default":{"description":"successful + operation"}}}}},"securityDefinitions":{"api_key":{"type":"apiKey","name":"api_key","in":"header"},"petstore_auth":{"type":"oauth2","authorizationUrl":"https://petstore.swagger.io/oauth/authorize","flow":"implicit","scopes":{"read:pets":"read + your pets","write:pets":"modify pets in your account"}}},"definitions":{"ApiResponse":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"type":{"type":"string"},"message":{"type":"string"}}},"Category":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Category"}},"Pet":{"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64"},"category":{"$ref":"#/definitions/Category"},"name":{"type":"string","example":"doggie"},"photoUrls":{"type":"array","xml":{"wrapped":true},"items":{"type":"string","xml":{"name":"photoUrl"}}},"tags":{"type":"array","xml":{"wrapped":true},"items":{"xml":{"name":"tag"},"$ref":"#/definitions/Tag"}},"status":{"type":"string","description":"pet + status in the store","enum":["available","pending","sold"]}},"xml":{"name":"Pet"}},"Tag":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}},"xml":{"name":"Tag"}},"Order":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"petId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order + Status","enum":["placed","approved","delivered"]},"complete":{"type":"boolean"}},"xml":{"name":"Order"}},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User + Status"}},"xml":{"name":"User"}}},"externalDocs":{"description":"Find out + more about Swagger","url":"http://swagger.io"}}' + headers: + access-control-allow-headers: + - Content-Type, api_key, Authorization + access-control-allow-methods: + - GET, POST, DELETE, PUT + access-control-allow-origin: + - '*' + connection: + - keep-alive + content-type: + - application/json + date: + - Fri, 11 Oct 2024 06:41:24 GMT + server: + - Jetty(9.2.9.v20150224) + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"properties": {"contacts": [{"email": "apiteam@swagger.io"}], "description": + "This is a sample server Petstore server. You can find out more about Swagger + at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For + this sample, you can use the api key `special-key` to test the authorization + filters.", "externalDocumentation": [{"description": "Find out more about Swagger", + "title": "Title", "url": "http://swagger.io"}], "kind": "rest", "license": {"name": + "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html"}, "title": + "Swagger Petstore"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api register + Connection: + - keep-alive + Content-Length: + - '611' + Content-Type: + - application/json + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"Swagger + Petstore","description":"This is a sample server Petstore server. You can + find out more about Swagger at [http://swagger.io](http://swagger.io) or on + [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you + can use the api key `special-key` to test the authorization filters.","kind":"rest","license":{"name":"Apache + 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"externalDocumentation":[{"title":"Title","description":"Find + out more about Swagger","url":"http://swagger.io"}],"contacts":[{"email":"apiteam@swagger.io"}],"customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore","name":"swaggerpetstore","systemData":{"createdAt":"2024-10-11T06:41:26.982954Z","lastModifiedAt":"2024-10-11T06:41:26.9829504Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '975' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:41:27 GMT + etag: + - f600f317-0000-0100-0000-6708c8960000 + 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-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: 47AB8AD5E33D49B19145B5185B8F1945 Ref B: MAA201060513033 Ref C: 2024-10-11T06:41:25Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"lifecycleStage": "design", "title": "1-0-7"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api register + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore/versions/1-0-7?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"1-0-7","lifecycleStage":"design"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore/versions/1-0-7","name":"1-0-7","systemData":{"createdAt":"2024-10-11T06:41:29.7372051Z","lastModifiedAt":"2024-10-11T06:41:29.7371995Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '436' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:41:29 GMT + etag: + - 9f00e006-0000-0100-0000-6708c8990000 + 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-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: D5DBCAFEB97C48C7804A4BBE5589F275 Ref B: MAA201060514045 Ref C: 2024-10-11T06:41:27Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"description": "This is a sample server Petstore server. You + can find out more about Swagger at [http://swagger.io](http://swagger.io) or + on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you + can use the api key `special-key` to test the authorization filters.", "title": + "openapi"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api register + Connection: + - keep-alive + Content-Length: + - '325' + Content-Type: + - application/json + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore/versions/1-0-7/definitions/openapi?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions/definitions","properties":{"title":"openapi","description":"This + is a sample server Petstore server. You can find out more about Swagger at + [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For + this sample, you can use the api key `special-key` to test the authorization + filters."},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore/versions/1-0-7/definitions/openapi","name":"openapi","systemData":{"createdAt":"2024-10-11T06:41:32.5069135Z","lastModifiedAt":"2024-10-11T06:41:32.5069097Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '733' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:41:32 GMT + etag: + - a30050dc-0000-0100-0000-6708c89c0000 + 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-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: CCD120D502EA4171968110C1BF039D35 Ref B: MAA201060516053 Ref C: 2024-10-11T06:41:30Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"format": "link", "specification": {"name": "openapi", "version": "2-0"}, + "value": "https://petstore.swagger.io/v2/swagger.json"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api register + Connection: + - keep-alive + Content-Length: + - '130' + Content-Type: + - application/json + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore/versions/1-0-7/definitions/openapi/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, 11 Oct 2024 06:41:34 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore/versions/1-0-7/definitions/openapi/operationResults/d5a8f2f53b6b4180a83e4b1899359fc7?api-version=2024-03-01&t=638642256945866133&c=MIIHhzCCBm-gAwIBAgITfAWQ0hCHZtQ3fJ4PSAAABZDSEDANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDUwHhcNMjQwOTI3MDkwMTAzWhcNMjUwMzI2MDkwMTAzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANt7qVbg97HivqUzi3BPPNiHD4wLqYw03AkBiXDpww3W8iI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ta1Dud4RchYh74jtodoiwmneC_ZG5VDcpozae4Mh1w3_kD4-E11i1U1U&s=D71sEVLZpEZWmZ6VboAkOTt7Tl1m4fF7mlj7u5GDNIcvL8QirXrXeVkJ6zMATHQ_qZ3x9JweD2MU63h-zdOvmhix1tNuanluOW1mCdainLkpg-2gCUsGd-LsE8pvnq6Qvps8EhQdUt3O1Fu4VBwvyV3j9kJ1Xj5OPAFsHAoG8Or-oQSil2h56liCsuyf2ikwlvilVThxrQGsoEw26qADDpo4LWyRqIRSm6Cum-m27Qc1mjlDzT-fGeXN0SOo9ntArEJX4VF9vOHooudboxuRZvJMw9YtGxzO8ZaCRSIIcm9-gzvKBAcIuMQTn4my58syAPRYgyS2yvlKoSLrn-WHkQ&h=weIyZoamaw49MmiAPpFs3_CSDvYn6oO6Emdpw_cRDy8 + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: B83174B6DEC54F85BC4C65E3284FBA7E Ref B: MAA201060514019 Ref C: 2024-10-11T06:41:33Z' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api register + Connection: + - keep-alive + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore/versions/1-0-7/definitions/openapi/operationResults/d5a8f2f53b6b4180a83e4b1899359fc7?api-version=2024-03-01&t=638642256945866133&c=MIIHhzCCBm-gAwIBAgITfAWQ0hCHZtQ3fJ4PSAAABZDS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jAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFB6-4Y-Z7skVWaPi2vBOob5I-JLv_MqkE8tGWMMCFI9McOWBWfeJWV7aA4X4MEwnVfuFzE4mdak49KhEWgAbnGBMMumWJtlE1VDYwoYj3k6VDrhg4K8cRAO24Ezl3_L9yTqPLHhnKpjnjZONChdqvy6tXy9zLDyo9uThhHykSdIVQPaynG83JYpUlN1akyNJVLxae9NCRV251OTh00g9z6gt1b4nk-Nszy6YtF1AoskPTpeZVcsxGTlq3ITXveDCeZrYbQ6EtZf5O8ekTrNsG-8DMSDIgDta1Dud4RchYh74jtodoiwmneC_ZG5VDcpozae4Mh1w3_kD4-E11i1U1U&s=D71sEVLZpEZWmZ6VboAkOTt7Tl1m4fF7mlj7u5GDNIcvL8QirXrXeVkJ6zMATHQ_qZ3x9JweD2MU63h-zdOvmhix1tNuanluOW1mCdainLkpg-2gCUsGd-LsE8pvnq6Qvps8EhQdUt3O1Fu4VBwvyV3j9kJ1Xj5OPAFsHAoG8Or-oQSil2h56liCsuyf2ikwlvilVThxrQGsoEw26qADDpo4LWyRqIRSm6Cum-m27Qc1mjlDzT-fGeXN0SOo9ntArEJX4VF9vOHooudboxuRZvJMw9YtGxzO8ZaCRSIIcm9-gzvKBAcIuMQTn4my58syAPRYgyS2yvlKoSLrn-WHkQ&h=weIyZoamaw49MmiAPpFs3_CSDvYn6oO6Emdpw_cRDy8 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/apis/swaggerpetstore/versions/1-0-7/definitions/openapi/operationResults/d5a8f2f53b6b4180a83e4b1899359fc7","name":"d5a8f2f53b6b4180a83e4b1899359fc7","status":"InProgress","startTime":"2024-10-11T06:41:35.1365493+00:00"}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '358' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:41:35 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore/versions/1-0-7/definitions/openapi/operationResults/d5a8f2f53b6b4180a83e4b1899359fc7?api-version=2024-03-01&t=638642256954460014&c=MIIHhzCCBm-gAwIBAgITfAWQ0hCHZtQ3fJ4PSAAABZDSEDANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDUwHhcNMjQwOTI3MDkwMTAzWhcNMjUwMzI2MDkwMTAzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANt7qVbg97HivqUzi3BPPNiHD4wLqYw03AkBiXDpww3W8iIU6FZbbOXVgCL-rGpnbxPkLEVZ1WtRfvLgR3qDiVRjkSnE2knSE6qtvBRWdqqsD9YiSi5lYW67vgtBA_mHzHNDb0zhZ2iofVE5GjHIKYINZSTo8of54bY_fJe0xenYEq7lMpbffWaoano6LQH1L0hSdzAreTN7T_bTsK7TkXQtx45c1upRueZR1wq4PRd-9AYpkfKHhxnCe5LBeLB-Q88WZbmNxuycYiJZzbEGVcEbg5fYdfYb4QveB2WmK7bCWSEDu7WzRaYN9zfP9ZpVnTHTmRcN-f3uvUzxNBMe26UCAwEAAaOCBHQwggRwMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHLBggrBgEFB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-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: B54CE637BC504B1FB991C98BBABE9010 Ref B: MAA201060514019 Ref C: 2024-10-11T06:41:34Z' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api register + Connection: + - keep-alive + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore/versions/1-0-7/definitions/openapi/operationResults/d5a8f2f53b6b4180a83e4b1899359fc7?api-version=2024-03-01&t=638642256954460014&c=MIIHhzCCBm-gAwIBAgITfAWQ0hCHZtQ3fJ4PSAAABZDSEDANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDUwHhcNMjQwOTI3MDkwMTAzWhcNMjUwMzI2MDkwMTAzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANt7qVbg97HivqUzi3BPPNiHD4wLqYw03AkBiXDpww3W8iIU6FZbbOXVgCL-rGpnbxPkLEVZ1WtRfvLgR3qDiVRjkSnE2knSE6qtvBRWdqqsD9YiSi5lYW67vgtBA_mHzHNDb0zhZ2iofVE5GjHIKYINZSTo8of54bY_fJe0xenYEq7lMpbffWaoano6LQH1L0hS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XS83-mMKStQjHzOXzxPqRzMtK2W8SQNEimPT-7ZStmh1O4nEoW_78Aqjia-e_GwxE0xfy-wH5Bkbv4QwWp_wdHzRKpLrIVs_0ohUuLqog_--cRwpzC0Ow7OQEEauz6staq1p7bTYqZ_HbiPA8r7yAddCbgHBub9J6nFI--pMBIhVHBeuEdQvbOcQ2_lEfYNeEe55EI6bDSHH6Q8LjualQk2oASFzHK_r4BPB-Wy_osMSin2wRG5NUTfFFIFcA&h=NCAPep6LmrA_YpWyWvm_EjpJR7ThUl0yOrjcToQP-bE + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/apis/swaggerpetstore/versions/1-0-7/definitions/openapi/operationResults/d5a8f2f53b6b4180a83e4b1899359fc7","name":"d5a8f2f53b6b4180a83e4b1899359fc7","status":"Succeeded","startTime":"2024-10-11T06:41:35.1365493+00:00","endTime":"2024-10-11T06:41:35.653496+00:00"}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '402' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:42: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-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: F9C033E85BDA45A59E504C32533929C4 Ref B: MAA201060514019 Ref C: 2024-10-11T06:42:05Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api show + Connection: + - keep-alive + ParameterSetName: + - -g -n --api-id + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"Swagger + Petstore","description":"This is a sample server Petstore server. You can + find out more about Swagger at [http://swagger.io](http://swagger.io) or on + [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you + can use the api key `special-key` to test the authorization filters.","kind":"rest","lifecycleStage":"design","license":{"name":"Apache + 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"externalDocumentation":[{"title":"Title","description":"Find + out more about Swagger","url":"http://swagger.io"}],"contacts":[{"email":"apiteam@swagger.io"}],"customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore","name":"swaggerpetstore","systemData":{"createdAt":"2024-10-11T06:41:26.982954Z","lastModifiedAt":"2024-10-11T06:41:26.9829504Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '1001' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:42:08 GMT + etag: + - f6003c18-0000-0100-0000-6708c8990000 + 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-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: C71F321B9930469BA25761D3A5F0272E Ref B: MAA201060515033 Ref C: 2024-10-11T06:42:06Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api version show + Connection: + - keep-alive + ParameterSetName: + - -g -n --api-id --version-id + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore/versions/1-0-7?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"1-0-7","lifecycleStage":"design"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore/versions/1-0-7","name":"1-0-7","systemData":{"createdAt":"2024-10-11T06:41:29.7372051Z","lastModifiedAt":"2024-10-11T06:41:29.7371995Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '436' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:42:10 GMT + etag: + - 9f00e006-0000-0100-0000-6708c8990000 + 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-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 3686EB357F5F4B4496E89C61B561525B Ref B: MAA201060514049 Ref C: 2024-10-11T06:42:08Z' + 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 -n --api-id --version-id --definition-id + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore/versions/1-0-7/definitions/openapi?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions/definitions","properties":{"title":"openapi","description":"This + is a sample server Petstore server. You can find out more about Swagger at + [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For + this sample, you can use the api key `special-key` to test the authorization + filters.","specification":{"name":"openapi","version":"2-0"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore/versions/1-0-7/definitions/openapi","name":"openapi","systemData":{"createdAt":"2024-10-11T06:41:32.5069135Z","lastModifiedAt":"2024-10-11T06:41:42.4151191Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '784' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:42:11 GMT + etag: + - a300bddc-0000-0100-0000-6708c8a60000 + 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-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 96C47CF2587049EAB994F241403B3A4B Ref B: MAA201060515011 Ref C: 2024-10-11T06:42:10Z' + 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_register_with_yaml_spec_from_url.yaml b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_register_with_yaml_spec_from_url.yaml new file mode 100644 index 00000000000..631b55a8666 --- /dev/null +++ b/src/apic-extension/azext_apic_extension/tests/latest/recordings/test_register_with_yaml_spec_from_url.yaml @@ -0,0 +1,774 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.32.3 + method: GET + uri: https://petstore.swagger.io/v2/swagger.yaml + response: + body: + string: "---\nswagger: \"2.0\"\ninfo:\n description: \"This is a sample server\ + \ Petstore server. You can find out more about\\\n \\ Swagger at [http://swagger.io](http://swagger.io)\ + \ or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\\\n \\ For\ + \ this sample, you can use the api key `special-key` to test the authorization\\\ + \n \\ filters.\"\n version: \"1.0.7\"\n title: \"Swagger Petstore\"\n\ + \ termsOfService: \"http://swagger.io/terms/\"\n contact:\n email: \"\ + apiteam@swagger.io\"\n license:\n name: \"Apache 2.0\"\n url: \"http://www.apache.org/licenses/LICENSE-2.0.html\"\ + \nhost: \"petstore.swagger.io\"\nbasePath: \"/v2\"\ntags:\n- name: \"pet\"\ + \n description: \"Everything about your Pets\"\n externalDocs:\n description:\ + \ \"Find out more\"\n url: \"http://swagger.io\"\n- name: \"store\"\n \ + \ description: \"Access to Petstore orders\"\n- name: \"user\"\n description:\ + \ \"Operations about user\"\n externalDocs:\n description: \"Find out\ + \ more about our store\"\n url: \"http://swagger.io\"\nschemes:\n- \"https\"\ + \n- \"http\"\npaths:\n /pet/{petId}/uploadImage:\n post:\n tags:\n\ + \ - \"pet\"\n summary: \"uploads an image\"\n description:\ + \ \"\"\n operationId: \"uploadFile\"\n consumes:\n - \"multipart/form-data\"\ + \n produces:\n - \"application/json\"\n parameters:\n \ + \ - name: \"petId\"\n in: \"path\"\n description: \"ID of pet\ + \ to update\"\n required: true\n type: \"integer\"\n \ + \ format: \"int64\"\n - name: \"additionalMetadata\"\n in: \"\ + formData\"\n description: \"Additional data to pass to server\"\n \ + \ required: false\n type: \"string\"\n - name: \"file\"\n\ + \ in: \"formData\"\n description: \"file to upload\"\n \ + \ required: false\n type: \"file\"\n responses:\n 200:\n\ + \ description: \"successful operation\"\n schema:\n \ + \ $ref: \"#/definitions/ApiResponse\"\n security:\n - petstore_auth:\n\ + \ - \"write:pets\"\n - \"read:pets\"\n /pet:\n post:\n \ + \ tags:\n - \"pet\"\n summary: \"Add a new pet to the store\"\ + \n description: \"\"\n operationId: \"addPet\"\n consumes:\n\ + \ - \"application/json\"\n - \"application/xml\"\n produces:\n\ + \ - \"application/json\"\n - \"application/xml\"\n parameters:\n\ + \ - in: \"body\"\n name: \"body\"\n description: \"Pet\ + \ object that needs to be added to the store\"\n required: true\n \ + \ schema:\n $ref: \"#/definitions/Pet\"\n responses:\n\ + \ 405:\n description: \"Invalid input\"\n security:\n\ + \ - petstore_auth:\n - \"write:pets\"\n - \"read:pets\"\ + \n put:\n tags:\n - \"pet\"\n summary: \"Update an existing\ + \ pet\"\n description: \"\"\n operationId: \"updatePet\"\n \ + \ consumes:\n - \"application/json\"\n - \"application/xml\"\n \ + \ produces:\n - \"application/json\"\n - \"application/xml\"\ + \n parameters:\n - in: \"body\"\n name: \"body\"\n \ + \ description: \"Pet object that needs to be added to the store\"\n \ + \ required: true\n schema:\n $ref: \"#/definitions/Pet\"\ + \n responses:\n 400:\n description: \"Invalid ID supplied\"\ + \n 404:\n description: \"Pet not found\"\n 405:\n \ + \ description: \"Validation exception\"\n security:\n -\ + \ petstore_auth:\n - \"write:pets\"\n - \"read:pets\"\n /pet/findByStatus:\n\ + \ get:\n tags:\n - \"pet\"\n summary: \"Finds Pets by status\"\ + \n description: \"Multiple status values can be provided with comma separated\ + \ strings\"\n operationId: \"findPetsByStatus\"\n produces:\n \ + \ - \"application/json\"\n - \"application/xml\"\n parameters:\n\ + \ - name: \"status\"\n in: \"query\"\n description: \"\ + Status values that need to be considered for filter\"\n required: true\n\ + \ type: \"array\"\n items:\n type: \"string\"\n \ + \ enum:\n - \"available\"\n - \"pending\"\n \ + \ - \"sold\"\n default: \"available\"\n collectionFormat:\ + \ \"multi\"\n responses:\n 200:\n description: \"successful\ + \ operation\"\n schema:\n type: \"array\"\n \ + \ items:\n $ref: \"#/definitions/Pet\"\n 400:\n \ + \ description: \"Invalid status value\"\n security:\n - petstore_auth:\n\ + \ - \"write:pets\"\n - \"read:pets\"\n /pet/findByTags:\n \ + \ get:\n tags:\n - \"pet\"\n summary: \"Finds Pets by tags\"\ + \n description: \"Multiple tags can be provided with comma separated\ + \ strings. Use\\\n \\ tag1, tag2, tag3 for testing.\"\n operationId:\ + \ \"findPetsByTags\"\n produces:\n - \"application/json\"\n \ + \ - \"application/xml\"\n parameters:\n - name: \"tags\"\n \ + \ in: \"query\"\n description: \"Tags to filter by\"\n required:\ + \ true\n type: \"array\"\n items:\n type: \"string\"\ + \n collectionFormat: \"multi\"\n responses:\n 200:\n \ + \ description: \"successful operation\"\n schema:\n \ + \ type: \"array\"\n items:\n $ref: \"#/definitions/Pet\"\ + \n 400:\n description: \"Invalid tag value\"\n security:\n\ + \ - petstore_auth:\n - \"write:pets\"\n - \"read:pets\"\ + \n deprecated: true\n /pet/{petId}:\n get:\n tags:\n -\ + \ \"pet\"\n summary: \"Find pet by ID\"\n description: \"Returns\ + \ a single pet\"\n operationId: \"getPetById\"\n produces:\n \ + \ - \"application/json\"\n - \"application/xml\"\n parameters:\n\ + \ - name: \"petId\"\n in: \"path\"\n description: \"ID\ + \ of pet to return\"\n required: true\n type: \"integer\"\n\ + \ format: \"int64\"\n responses:\n 200:\n description:\ + \ \"successful operation\"\n schema:\n $ref: \"#/definitions/Pet\"\ + \n 400:\n description: \"Invalid ID supplied\"\n 404:\n\ + \ description: \"Pet not found\"\n security:\n - api_key:\ + \ []\n post:\n tags:\n - \"pet\"\n summary: \"Updates a\ + \ pet in the store with form data\"\n description: \"\"\n operationId:\ + \ \"updatePetWithForm\"\n consumes:\n - \"application/x-www-form-urlencoded\"\ + \n produces:\n - \"application/json\"\n - \"application/xml\"\ + \n parameters:\n - name: \"petId\"\n in: \"path\"\n \ + \ description: \"ID of pet that needs to be updated\"\n required:\ + \ true\n type: \"integer\"\n format: \"int64\"\n - name:\ + \ \"name\"\n in: \"formData\"\n description: \"Updated name\ + \ of the pet\"\n required: false\n type: \"string\"\n -\ + \ name: \"status\"\n in: \"formData\"\n description: \"Updated\ + \ status of the pet\"\n required: false\n type: \"string\"\n\ + \ responses:\n 405:\n description: \"Invalid input\"\n\ + \ security:\n - petstore_auth:\n - \"write:pets\"\n \ + \ - \"read:pets\"\n delete:\n tags:\n - \"pet\"\n summary:\ + \ \"Deletes a pet\"\n description: \"\"\n operationId: \"deletePet\"\ + \n produces:\n - \"application/json\"\n - \"application/xml\"\ + \n parameters:\n - name: \"api_key\"\n in: \"header\"\n \ + \ required: false\n type: \"string\"\n - name: \"petId\"\ + \n in: \"path\"\n description: \"Pet id to delete\"\n \ + \ required: true\n type: \"integer\"\n format: \"int64\"\n\ + \ responses:\n 400:\n description: \"Invalid ID supplied\"\ + \n 404:\n description: \"Pet not found\"\n security:\n\ + \ - petstore_auth:\n - \"write:pets\"\n - \"read:pets\"\ + \n /store/inventory:\n get:\n tags:\n - \"store\"\n summary:\ + \ \"Returns pet inventories by status\"\n description: \"Returns a map\ + \ of status codes to quantities\"\n operationId: \"getInventory\"\n \ + \ produces:\n - \"application/json\"\n parameters: []\n \ + \ responses:\n 200:\n description: \"successful operation\"\ + \n schema:\n type: \"object\"\n additionalProperties:\n\ + \ type: \"integer\"\n format: \"int32\"\n security:\n\ + \ - api_key: []\n /store/order:\n post:\n tags:\n - \"\ + store\"\n summary: \"Place an order for a pet\"\n description: \"\ + \"\n operationId: \"placeOrder\"\n consumes:\n - \"application/json\"\ + \n produces:\n - \"application/json\"\n - \"application/xml\"\ + \n parameters:\n - in: \"body\"\n name: \"body\"\n \ + \ description: \"order placed for purchasing the pet\"\n required:\ + \ true\n schema:\n $ref: \"#/definitions/Order\"\n responses:\n\ + \ 200:\n description: \"successful operation\"\n \ + \ schema:\n $ref: \"#/definitions/Order\"\n 400:\n \ + \ description: \"Invalid Order\"\n /store/order/{orderId}:\n get:\n\ + \ tags:\n - \"store\"\n summary: \"Find purchase order by ID\"\ + \n description: \"For valid response try integer IDs with value >= 1\ + \ and <= 10.\\\n \\ Other values will generated exceptions\"\n \ + \ operationId: \"getOrderById\"\n produces:\n - \"application/json\"\ + \n - \"application/xml\"\n parameters:\n - name: \"orderId\"\ + \n in: \"path\"\n description: \"ID of pet that needs to be\ + \ fetched\"\n required: true\n type: \"integer\"\n maximum:\ + \ 10\n minimum: 1\n format: \"int64\"\n responses:\n \ + \ 200:\n description: \"successful operation\"\n schema:\n\ + \ $ref: \"#/definitions/Order\"\n 400:\n description:\ + \ \"Invalid ID supplied\"\n 404:\n description: \"Order not\ + \ found\"\n delete:\n tags:\n - \"store\"\n summary: \"\ + Delete purchase order by ID\"\n description: \"For valid response try\ + \ integer IDs with positive integer value.\\\n \\ Negative or non-integer\ + \ values will generate API errors\"\n operationId: \"deleteOrder\"\n\ + \ produces:\n - \"application/json\"\n - \"application/xml\"\ + \n parameters:\n - name: \"orderId\"\n in: \"path\"\n \ + \ description: \"ID of the order that needs to be deleted\"\n required:\ + \ true\n type: \"integer\"\n minimum: 1\n format: \"\ + int64\"\n responses:\n 400:\n description: \"Invalid\ + \ ID supplied\"\n 404:\n description: \"Order not found\"\n\ + \ /user/createWithList:\n post:\n tags:\n - \"user\"\n \ + \ summary: \"Creates list of users with given input array\"\n description:\ + \ \"\"\n operationId: \"createUsersWithListInput\"\n consumes:\n\ + \ - \"application/json\"\n produces:\n - \"application/json\"\ + \n - \"application/xml\"\n parameters:\n - in: \"body\"\n \ + \ name: \"body\"\n description: \"List of user object\"\n \ + \ required: true\n schema:\n type: \"array\"\n \ + \ items:\n $ref: \"#/definitions/User\"\n responses:\n \ + \ default:\n description: \"successful operation\"\n /user/{username}:\n\ + \ get:\n tags:\n - \"user\"\n summary: \"Get user by user\ + \ name\"\n description: \"\"\n operationId: \"getUserByName\"\n\ + \ produces:\n - \"application/json\"\n - \"application/xml\"\ + \n parameters:\n - name: \"username\"\n in: \"path\"\n \ + \ description: \"The name that needs to be fetched. Use user1 for testing.\ + \ \"\n required: true\n type: \"string\"\n responses:\n\ + \ 200:\n description: \"successful operation\"\n \ + \ schema:\n $ref: \"#/definitions/User\"\n 400:\n \ + \ description: \"Invalid username supplied\"\n 404:\n description:\ + \ \"User not found\"\n put:\n tags:\n - \"user\"\n summary:\ + \ \"Updated user\"\n description: \"This can only be done by the logged\ + \ in user.\"\n operationId: \"updateUser\"\n consumes:\n -\ + \ \"application/json\"\n produces:\n - \"application/json\"\n \ + \ - \"application/xml\"\n parameters:\n - name: \"username\"\n\ + \ in: \"path\"\n description: \"name that need to be updated\"\ + \n required: true\n type: \"string\"\n - in: \"body\"\n\ + \ name: \"body\"\n description: \"Updated user object\"\n \ + \ required: true\n schema:\n $ref: \"#/definitions/User\"\ + \n responses:\n 400:\n description: \"Invalid user supplied\"\ + \n 404:\n description: \"User not found\"\n delete:\n \ + \ tags:\n - \"user\"\n summary: \"Delete user\"\n description:\ + \ \"This can only be done by the logged in user.\"\n operationId: \"\ + deleteUser\"\n produces:\n - \"application/json\"\n - \"application/xml\"\ + \n parameters:\n - name: \"username\"\n in: \"path\"\n \ + \ description: \"The name that needs to be deleted\"\n required:\ + \ true\n type: \"string\"\n responses:\n 400:\n \ + \ description: \"Invalid username supplied\"\n 404:\n description:\ + \ \"User not found\"\n /user/login:\n get:\n tags:\n - \"user\"\ + \n summary: \"Logs user into the system\"\n description: \"\"\n\ + \ operationId: \"loginUser\"\n produces:\n - \"application/json\"\ + \n - \"application/xml\"\n parameters:\n - name: \"username\"\ + \n in: \"query\"\n description: \"The user name for login\"\n\ + \ required: true\n type: \"string\"\n - name: \"password\"\ + \n in: \"query\"\n description: \"The password for login in\ + \ clear text\"\n required: true\n type: \"string\"\n responses:\n\ + \ 200:\n description: \"successful operation\"\n \ + \ headers:\n X-Expires-After:\n type: \"string\"\n\ + \ format: \"date-time\"\n description: \"date in\ + \ UTC when token expires\"\n X-Rate-Limit:\n type:\ + \ \"integer\"\n format: \"int32\"\n description:\ + \ \"calls per hour allowed by the user\"\n schema:\n type:\ + \ \"string\"\n 400:\n description: \"Invalid username/password\ + \ supplied\"\n /user/logout:\n get:\n tags:\n - \"user\"\n \ + \ summary: \"Logs out current logged in user session\"\n description:\ + \ \"\"\n operationId: \"logoutUser\"\n produces:\n - \"application/json\"\ + \n - \"application/xml\"\n parameters: []\n responses:\n \ + \ default:\n description: \"successful operation\"\n /user/createWithArray:\n\ + \ post:\n tags:\n - \"user\"\n summary: \"Creates list of\ + \ users with given input array\"\n description: \"\"\n operationId:\ + \ \"createUsersWithArrayInput\"\n consumes:\n - \"application/json\"\ + \n produces:\n - \"application/json\"\n - \"application/xml\"\ + \n parameters:\n - in: \"body\"\n name: \"body\"\n \ + \ description: \"List of user object\"\n required: true\n schema:\n\ + \ type: \"array\"\n items:\n $ref: \"#/definitions/User\"\ + \n responses:\n default:\n description: \"successful\ + \ operation\"\n /user:\n post:\n tags:\n - \"user\"\n summary:\ + \ \"Create user\"\n description: \"This can only be done by the logged\ + \ in user.\"\n operationId: \"createUser\"\n consumes:\n -\ + \ \"application/json\"\n produces:\n - \"application/json\"\n \ + \ - \"application/xml\"\n parameters:\n - in: \"body\"\n \ + \ name: \"body\"\n description: \"Created user object\"\n \ + \ required: true\n schema:\n $ref: \"#/definitions/User\"\ + \n responses:\n default:\n description: \"successful\ + \ operation\"\nsecurityDefinitions:\n api_key:\n type: \"apiKey\"\n \ + \ name: \"api_key\"\n in: \"header\"\n petstore_auth:\n type: \"oauth2\"\ + \n authorizationUrl: \"https://petstore.swagger.io/oauth/authorize\"\n\ + \ flow: \"implicit\"\n scopes:\n read:pets: \"read your pets\"\n\ + \ write:pets: \"modify pets in your account\"\ndefinitions:\n ApiResponse:\n\ + \ type: \"object\"\n properties:\n code:\n type: \"integer\"\ + \n format: \"int32\"\n type:\n type: \"string\"\n \ + \ message:\n type: \"string\"\n Category:\n type: \"object\"\n\ + \ properties:\n id:\n type: \"integer\"\n format: \"\ + int64\"\n name:\n type: \"string\"\n xml:\n name: \"Category\"\ + \n Pet:\n type: \"object\"\n required:\n - \"name\"\n - \"photoUrls\"\ + \n properties:\n id:\n type: \"integer\"\n format: \"\ + int64\"\n category:\n $ref: \"#/definitions/Category\"\n \ + \ name:\n type: \"string\"\n example: \"doggie\"\n photoUrls:\n\ + \ type: \"array\"\n xml:\n wrapped: true\n items:\n\ + \ type: \"string\"\n xml:\n name: \"photoUrl\"\ + \n tags:\n type: \"array\"\n xml:\n wrapped: true\n\ + \ items:\n xml:\n name: \"tag\"\n $ref:\ + \ \"#/definitions/Tag\"\n status:\n type: \"string\"\n \ + \ description: \"pet status in the store\"\n enum:\n - \"available\"\ + \n - \"pending\"\n - \"sold\"\n xml:\n name: \"Pet\"\ + \n Tag:\n type: \"object\"\n properties:\n id:\n type:\ + \ \"integer\"\n format: \"int64\"\n name:\n type: \"string\"\ + \n xml:\n name: \"Tag\"\n Order:\n type: \"object\"\n properties:\n\ + \ id:\n type: \"integer\"\n format: \"int64\"\n petId:\n\ + \ type: \"integer\"\n format: \"int64\"\n quantity:\n \ + \ type: \"integer\"\n format: \"int32\"\n shipDate:\n \ + \ type: \"string\"\n format: \"date-time\"\n status:\n \ + \ type: \"string\"\n description: \"Order Status\"\n enum:\n\ + \ - \"placed\"\n - \"approved\"\n - \"delivered\"\n \ + \ complete:\n type: \"boolean\"\n xml:\n name: \"Order\"\ + \n User:\n type: \"object\"\n properties:\n id:\n type:\ + \ \"integer\"\n format: \"int64\"\n username:\n type: \"\ + string\"\n firstName:\n type: \"string\"\n lastName:\n \ + \ type: \"string\"\n email:\n type: \"string\"\n password:\n\ + \ type: \"string\"\n phone:\n type: \"string\"\n userStatus:\n\ + \ type: \"integer\"\n format: \"int32\"\n description:\ + \ \"User Status\"\n xml:\n name: \"User\"\nexternalDocs:\n description:\ + \ \"Find out more about Swagger\"\n url: \"http://swagger.io\"\n" + headers: + access-control-allow-headers: + - Content-Type, api_key, Authorization + access-control-allow-methods: + - GET, POST, DELETE, PUT + access-control-allow-origin: + - '*' + connection: + - keep-alive + content-type: + - application/yaml + date: + - Fri, 11 Oct 2024 06:41:24 GMT + server: + - Jetty(9.2.9.v20150224) + transfer-encoding: + - chunked + status: + code: 200 + message: OK +- request: + body: '{"properties": {"contacts": [{"email": "apiteam@swagger.io"}], "description": + "This is a sample server Petstore server. You can find out more about Swagger + at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For + this sample, you can use the api key `special-key` to test the authorization + filters.", "externalDocumentation": [{"description": "Find out more about Swagger", + "title": "Title", "url": "http://swagger.io"}], "kind": "rest", "license": {"name": + "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html"}, "title": + "Swagger Petstore"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api register + Connection: + - keep-alive + Content-Length: + - '611' + Content-Type: + - application/json + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"Swagger + Petstore","description":"This is a sample server Petstore server. You can + find out more about Swagger at [http://swagger.io](http://swagger.io) or on + [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you + can use the api key `special-key` to test the authorization filters.","kind":"rest","license":{"name":"Apache + 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"externalDocumentation":[{"title":"Title","description":"Find + out more about Swagger","url":"http://swagger.io"}],"contacts":[{"email":"apiteam@swagger.io"}],"customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore","name":"swaggerpetstore","systemData":{"createdAt":"2024-10-11T06:41:26.8485347Z","lastModifiedAt":"2024-10-11T06:41:26.8485304Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '976' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:41:26 GMT + etag: + - f600f117-0000-0100-0000-6708c8960000 + 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-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: 91FCE6D2DCD64421A44DE27E017711CE Ref B: MAA201060513051 Ref C: 2024-10-11T06:41:25Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"lifecycleStage": "design", "title": "1-0-7"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api register + Connection: + - keep-alive + Content-Length: + - '62' + Content-Type: + - application/json + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore/versions/1-0-7?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"1-0-7","lifecycleStage":"design"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore/versions/1-0-7","name":"1-0-7","systemData":{"createdAt":"2024-10-11T06:41:29.4899069Z","lastModifiedAt":"2024-10-11T06:41:29.4899011Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '436' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:41:29 GMT + etag: + - 9f00dd06-0000-0100-0000-6708c8990000 + 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-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: 49658204FE9E4444B1DC453BF14DE8CE Ref B: MAA201060516045 Ref C: 2024-10-11T06:41:27Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"properties": {"description": "This is a sample server Petstore server. You + can find out more about Swagger at [http://swagger.io](http://swagger.io) or + on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you + can use the api key `special-key` to test the authorization filters.", "title": + "openapi"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api register + Connection: + - keep-alive + Content-Length: + - '325' + Content-Type: + - application/json + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore/versions/1-0-7/definitions/openapi?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions/definitions","properties":{"title":"openapi","description":"This + is a sample server Petstore server. You can find out more about Swagger at + [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For + this sample, you can use the api key `special-key` to test the authorization + filters."},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore/versions/1-0-7/definitions/openapi","name":"openapi","systemData":{"createdAt":"2024-10-11T06:41:32.0699736Z","lastModifiedAt":"2024-10-11T06:41:32.069966Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '732' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:41:33 GMT + etag: + - a3004bdc-0000-0100-0000-6708c89c0000 + 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-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: A87701DAE68B42788412FDF6E0C2C91B Ref B: MAA201060513037 Ref C: 2024-10-11T06:41:30Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"format": "link", "specification": {"name": "openapi", "version": "2-0"}, + "value": "https://petstore.swagger.io/v2/swagger.yaml"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api register + Connection: + - keep-alive + Content-Length: + - '130' + Content-Type: + - application/json + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore/versions/1-0-7/definitions/openapi/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, 11 Oct 2024 06:41:35 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore/versions/1-0-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gBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwEwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBR61hmFKHlscXYeYPjzS--iBUIWHTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAFB6-4Y-Z7skVWaPi2vBOob5I-JLv_MqkE8tGWMMCFI9McOWBWfeJWV7aA4X4MEwnVfuFzE4mdak49KhEWgAbnGBMMumWJtlE1VDYwoYj3k6VDrhg4K8cRAO24Ezl3_L9yTqPLHhnKpjnjZONChdqvy6tXy9zLDyo9uThhHykSdIVQPaynG83JYpUlN1akyNJVLxae9NCRV251OTh00g9z6gt1b4nk-Nszy6YtF1AoskPTpeZVcsxGTlq3ITXveDCeZrYbQ6EtZf5O8ekTrNsG-8DMSDIgDta1Dud4RchYh74jtodoiwmneC_ZG5VDcpozae4Mh1w3_kD4-E11i1U1U&s=NXQAx2ULMiBxkI6I3Si-d6LdcPTSLElk0IHrS5WcI_zERdQ_OyFbv_ipzclDNwQZEq835l9nHj7OTFzMtGY8cn27gJLZgVVk9X_2YvxT37IuqGryXbohiHLoBVaEcqT1FfLgIHekuFQ9SVAEWBlMf4SdodiuKqW3eZXDx77X0y4OQCl7xB1uXtG2xAz2Y94mSKO8mDFz5lKVYltyuIBiHm3ogQnbDN3g_bSu1DM5t2JtVkqDMsj5VD3tuUe-OpWRM-HUq6R4vsjG5680wtYDpsi-Du3qrO4B4n7PRjoLzGhG5w7Hw8_Rerf-xRxUsPHeYWVg8ijyb_pf4oYpttRomw&h=sb6XoQgn7sj8-cMpzI-rOFZ73FOm6WWzLfTj9BK8lMI + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-global-writes: + - '11999' + x-ms-ratelimit-remaining-subscription-writes: + - '799' + x-msedge-ref: + - 'Ref A: 9C0D30744A8C47799A86162B6DD3E6E0 Ref B: MAA201060515033 Ref C: 2024-10-11T06:41:34Z' + x-powered-by: + - ASP.NET + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api register + Connection: + - keep-alive + ParameterSetName: + - -g -n -l + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore/versions/1-0-7/definitions/openapi/operationResults/4377ec9c8a104560b2de1c59ad1a1a40?api-version=2024-03-01&t=638642256955510603&c=MIIHhzCCBm-gAwIBAgITfAWQ0hCHZtQ3fJ4PSAAABZDSEDANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDUwHhcNMjQwOTI3MDkwMTAzWhcNMjUwMzI2MDkwMTAzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANt7qVbg97HivqUzi3BPPNiHD4wLqYw03AkBiXDpww3W8iIU6FZbbOXVgCL-rGpnbxPkLEVZ1WtRfvLgR3qDiVRjkSnE2knSE6qtvBRWdqqsD9YiSi5lYW67vgtBA_mHzHNDb0zhZ2iofVE5GjHIKYINZSTo8of54bY_fJe0xenYEq7lMpbffWaoano6LQH1L0hSdzAreTN7T_bTsK7TkXQtx45c1upRueZR1wq4PRd-9AYpkfKHhxnCe5LBeLB-Q88WZbmNxuycYiJZzbEGVcEbg5fYdfYb4QveB2WmK7bCWSEDu7WzRaYN9zfP9ZpVnTHTmRcN-f3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DM5t2JtVkqDMsj5VD3tuUe-OpWRM-HUq6R4vsjG5680wtYDpsi-Du3qrO4B4n7PRjoLzGhG5w7Hw8_Rerf-xRxUsPHeYWVg8ijyb_pf4oYpttRomw&h=sb6XoQgn7sj8-cMpzI-rOFZ73FOm6WWzLfTj9BK8lMI + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/apis/swaggerpetstore/versions/1-0-7/definitions/openapi/operationResults/4377ec9c8a104560b2de1c59ad1a1a40","name":"4377ec9c8a104560b2de1c59ad1a1a40","status":"Succeeded","startTime":"2024-10-11T06:41:35.4520711+00:00","endTime":"2024-10-11T06:41:35.8868771+00:00"}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '403' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:41:36 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-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 18103CD4BEF84068A73EA6A5DC1E8052 Ref B: MAA201060515033 Ref C: 2024-10-11T06:41:35Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api show + Connection: + - keep-alive + ParameterSetName: + - -g -n --api-id + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis","properties":{"title":"Swagger + Petstore","description":"This is a sample server Petstore server. You can + find out more about Swagger at [http://swagger.io](http://swagger.io) or on + [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you + can use the api key `special-key` to test the authorization filters.","kind":"rest","lifecycleStage":"design","license":{"name":"Apache + 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"externalDocumentation":[{"title":"Title","description":"Find + out more about Swagger","url":"http://swagger.io"}],"contacts":[{"email":"apiteam@swagger.io"}],"customProperties":{}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore","name":"swaggerpetstore","systemData":{"createdAt":"2024-10-11T06:41:26.8485347Z","lastModifiedAt":"2024-10-11T06:41:26.8485304Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '1002' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:41:38 GMT + etag: + - f6003818-0000-0100-0000-6708c8990000 + 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-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 1204F970084B4A9CB786BE2678EF8D01 Ref B: MAA201060515027 Ref C: 2024-10-11T06:41:37Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - apic api version show + Connection: + - keep-alive + ParameterSetName: + - -g -n --api-id --version-id + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore/versions/1-0-7?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions","properties":{"title":"1-0-7","lifecycleStage":"design"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore/versions/1-0-7","name":"1-0-7","systemData":{"createdAt":"2024-10-11T06:41:29.4899069Z","lastModifiedAt":"2024-10-11T06:41:29.4899011Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '436' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:41:39 GMT + etag: + - 9f00dd06-0000-0100-0000-6708c8990000 + 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-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: FEA2809BB6C74D88BB6D15899AA4FF43 Ref B: MAA201060515037 Ref C: 2024-10-11T06:41:39Z' + 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 -n --api-id --version-id --definition-id + User-Agent: + - AZURECLI/2.63.0 azsdk-python-core/1.28.0 Python/3.11.9 (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/swaggerpetstore/versions/1-0-7/definitions/openapi?api-version=2024-03-01 + response: + body: + string: '{"type":"Microsoft.ApiCenter/services/workspaces/apis/versions/definitions","properties":{"title":"openapi","description":"This + is a sample server Petstore server. You can find out more about Swagger at + [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For + this sample, you can use the api key `special-key` to test the authorization + filters.","specification":{"name":"openapi","version":"2-0"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clirg000001/providers/Microsoft.ApiCenter/services/clitest000002/workspaces/default/apis/swaggerpetstore/versions/1-0-7/definitions/openapi","name":"openapi","systemData":{"createdAt":"2024-10-11T06:41:32.0699736Z","lastModifiedAt":"2024-10-11T06:41:40.375147Z"}}' + headers: + api-supported-versions: + - 2023-07-01-preview, 2024-03-01, 2024-03-15-preview + cache-control: + - no-cache + content-length: + - '783' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 11 Oct 2024 06:41:41 GMT + etag: + - a300a8dc-0000-0100-0000-6708c8a40000 + 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-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: EF811929704E496194C1711E79E9871B Ref B: MAA201060513023 Ref C: 2024-10-11T06:41:41Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/apic-extension/azext_apic_extension/tests/latest/test_register_command.py b/src/apic-extension/azext_apic_extension/tests/latest/test_register_command.py index 2f7640a87a1..2f346f87c60 100644 --- a/src/apic-extension/azext_apic_extension/tests/latest/test_register_command.py +++ b/src/apic-extension/azext_apic_extension/tests/latest/test_register_command.py @@ -4,6 +4,7 @@ # -------------------------------------------------------------------------------------------- import os +from azext_apic_extension.custom import logger from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer from .utils import ApicServicePreparer, ApicEnvironmentPreparer @@ -116,6 +117,104 @@ def test_register_with_json_spec(self): finally: os.remove(exported_file_path) + @ResourceGroupPreparer(name_prefix="clirg", location=TEST_REGION, random_name_length=32) + @ApicServicePreparer() + def test_register_with_json_spec_from_url(self): + self.kwargs.update({ + 'spec_url': 'https://petstore.swagger.io/v2/swagger.json' + }) + self.cmd('az apic api register -g {rg} -n {s} -l "{spec_url}"') + + # verify command results + self.cmd('az apic api show -g {rg} -n {s} --api-id swaggerpetstore', checks=[ + self.check('contacts[0].email', 'apiteam@swagger.io'), + self.check('description', 'This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.'), + self.check('kind', 'rest'), + self.check('license.name', 'Apache 2.0'), + self.check('license.url', 'http://www.apache.org/licenses/LICENSE-2.0.html'), + self.check('lifecycleStage', 'design'), + self.check('name', 'swaggerpetstore'), + self.check('summary', None), + self.check('title', 'Swagger Petstore'), + self.check('externalDocumentation', [{'description': 'Find out more about Swagger', 'title': 'Title', 'url': 'http://swagger.io'}]) + ]) + + self.cmd('az apic api version show -g {rg} -n {s} --api-id swaggerpetstore --version-id 1-0-7', checks=[ + self.check('lifecycleStage', 'design'), + self.check('name', '1-0-7'), + self.check('title', '1-0-7'), + ]) + + self.cmd('az apic api definition show -g {rg} -n {s} --api-id swaggerpetstore --version-id 1-0-7 --definition-id openapi', checks=[ + self.check('description', 'This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.'), + self.check('name', 'openapi'), + self.check('specification.name', 'openapi'), + self.check('specification.version', '2-0'), + self.check('title', 'openapi'), + ]) + + @ResourceGroupPreparer(name_prefix="clirg", location=TEST_REGION, random_name_length=32) + @ApicServicePreparer() + def test_register_with_yaml_spec_from_url(self): + self.kwargs.update({ + 'spec_url': 'https://petstore.swagger.io/v2/swagger.yaml' + }) + self.cmd('az apic api register -g {rg} -n {s} -l "{spec_url}"') + + # verify command results + self.cmd('az apic api show -g {rg} -n {s} --api-id swaggerpetstore', checks=[ + self.check('contacts[0].email', 'apiteam@swagger.io'), + self.check('description', 'This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.'), + self.check('kind', 'rest'), + self.check('license.name', 'Apache 2.0'), + self.check('license.url', 'http://www.apache.org/licenses/LICENSE-2.0.html'), + self.check('lifecycleStage', 'design'), + self.check('name', 'swaggerpetstore'), + self.check('summary', None), + self.check('title', 'Swagger Petstore'), + self.check('externalDocumentation', [{'description': 'Find out more about Swagger', 'title': 'Title', 'url': 'http://swagger.io'}]) + ]) + + self.cmd('az apic api version show -g {rg} -n {s} --api-id swaggerpetstore --version-id 1-0-7', checks=[ + self.check('lifecycleStage', 'design'), + self.check('name', '1-0-7'), + self.check('title', '1-0-7'), + ]) + + self.cmd('az apic api definition show -g {rg} -n {s} --api-id swaggerpetstore --version-id 1-0-7 --definition-id openapi', checks=[ + self.check('description', 'This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.'), + self.check('name', 'openapi'), + self.check('specification.name', 'openapi'), + self.check('specification.version', '2-0'), + self.check('title', 'openapi'), + ]) + + @ResourceGroupPreparer(name_prefix="clirg", location=TEST_REGION, random_name_length=32) + @ApicServicePreparer() + def test_register_with_invalid_spec_url(self): + # Set up an invalid URL + self.kwargs.update({ + 'spec_url': 'https://github.com/invalidrepo' + }) + # TODO: no other command check the error message, so we can't check the error message here + self.cmd('az apic api register -g {rg} -n {s} -l "{spec_url}"', expect_failure=True) + + # Verify the API is not registered + self.cmd('az apic api show -g {rg} -n {s} --api-id swaggerpetstore', expect_failure=True) + + @ResourceGroupPreparer(name_prefix="clirg", location=TEST_REGION, random_name_length=32) + @ApicServicePreparer() + def test_register_using_spec_url_with_invalid_content(self): + # Set up an URL with invalid spec + self.kwargs.update({ + 'spec_url': 'https://github.com/' + }) + # TODO: no other command check the error message, so we can't check the error message here + self.cmd('az apic api register -g {rg} -n {s} -l "{spec_url}"', expect_failure=True) + + # Verify the API is not registered + self.cmd('az apic api show -g {rg} -n {s} --api-id swaggerpetstore', expect_failure=True) + @ResourceGroupPreparer(name_prefix="clirg", location=TEST_REGION, random_name_length=32) @ApicServicePreparer() def test_register_with_long_openapi_description(self): @@ -145,4 +244,4 @@ def test_examples_register_with_yml_spec(self): self.kwargs.update({ 'spec_file': os.path.join(test_assets_dir, 'petstore.yml') }) - self.cmd('az apic api register -g {rg} -n {s} --api-location "{spec_file}" --environment-id {e}') + self.cmd('az apic api register -g {rg} -n {s} --api-location "{spec_file}" --environment-id {e}') \ No newline at end of file