Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.61k stars 5.01k forks source link

2021-01-01 MarketplaceOrdering PUT agreement API will return 404 if optional params aren't provided #14109

Open yungezz opened 3 years ago

yungezz commented 3 years ago

API: https://github.com/Azure/azure-rest-api-specs/blob/master/specification/marketplaceordering/resource-manager/Microsoft.MarketplaceOrdering/stable/2021-01-01/Agreements.json#L81

Request body : AgreementTerms , has property AgreementTermsProperties. Properties in AgreementTermsProperties aren't marked as required.

failed request/response

urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "PUT /subscriptions/ec0aa5f7-9e78-40c9-85cd-535c6305b380/providers/Microsoft.MarketplaceOrdering/offerTypes/virtualmachine/publishers/checkpoint/offers/vsec/plans/management/agreements/current?api-version=2021-01-01 HTTP/1.1" 404 225
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: {"properties": {"publisher": "checkpoint", "product": "vsec", "plan": "management"}}
cli.azure.cli.core.sdk.policies: Response status: 404
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"error":{"code":"NotFound","message":"Unable to find legal terms for this offer. Agreement has never been signed for this offer. offer = 'vsec', sku = 'management',  Correlation Id: '7a06656c-2dca-445c-8016-8fbfb251a43b'."}}

succeeded request/response


urllib3.connectionpool: https://management.azure.com:443 "PUT /subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/providers/Microsoft.MarketplaceOrdering/offerTypes/virtualmachine/publishers/checkpoint/offers/vsec/plans/management/agreements/current?api-version=2021-01-01 HTTP/1.1" 200 None
request body:
li.azure.cli.core.sdk.policies: {"properties": {"publisher": "checkpoint", "product": "vsec", "plan": "management", "licenseTextLink": "https://mpcprodsa.blob.core.windows.net/legalterms/3E5ED_legalterms_CHECKPOINT%253a24VSEC%253a24MANAGEMENT%253a2476HGNZSJREVLUQYE5WCZFRGIHF7HY2INZQW36Z5VLZ34BDJPP7742LAWDYIF7LIYDIM6RP55RIPRVIMZEOQWM6JL7YU7AD32MLUPYWY.txt", "privacyPolicyLink": "http://www.checkpoint.com/privacy", "marketplaceTermsLink": "https://mpcprodsa.blob.core.windows.net/marketplaceterms/3EDEF_marketplaceterms_AZUREAPPLICATION%253a24OF7TIMHFEMPZHRBYEO3SVLC7Q2MPXXAASJ5BO2FUY4UC6EZCN5TIL2KIGTA7WI2CSM3WV4L7QMPNRYPE2I7BOCM34RGOL3XTC6ADIMI.txt", "retrieveDatetime": "2021-04-25T05:47:39.5519164Z", "signature": "FM6IKWRFCMSMISDJRE2UEPNALT3AGR5IWDIZB22C6U2U3QJXVHY6DPV5QERQATSRMBGE4YE63UHWGA7FHH4IYHZG7FIOQV5LLNGZNCI", "accepted": true}}
cli.azure.cli.core.sdk.policies: Response status: 200
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"id":"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/providers/Microsoft.MarketplaceOrdering/offerTypes/Microsoft.MarketplaceOrdering/offertypes/publishers/checkpoint/offers/vsec/plans/management/agreements/current","name":"management","type":"Microsoft.MarketplaceOrdering/offertypes","properties":{"publisher":"checkpoint","product":"vsec","plan":"management","licenseTextLink":"https://mpcprodsa.blob.core.windows.net/legalterms/3E5ED_legalterms_CHECKPOINT%253a24VSEC%253a24MANAGEMENT%253a2476HGNZSJREVLUQYE5WCZFRGIHF7HY2INZQW36Z5VLZ34BDJPP7742LAWDYIF7LIYDIM6RP55RIPRVIMZEOQWM6JL7YU7AD32MLUPYWY.txt","privacyPolicyLink":"http://www.checkpoint.com/privacy","marketplaceTermsLink":"https://mpcprodsa.blob.core.windows.net/marketplaceterms/3EDEF_marketplaceterms_AZUREAPPLICATION%253a24OF7TIMHFEMPZHRBYEO3SVLC7Q2MPXXAASJ5BO2FUY4UC6EZCN5TIL2KIGTA7WI2CSM3WV4L7QMPNRYPE2I7BOCM34RGOL3XTC6ADIMI.txt","retrieveDatetime":"2021-04-25T05:47:39.5519164Z","signature":"FM6IKWRFCMSMISDJRE2UEPNALT3AGR5IWDIZB22C6U2U3QJXVHY6DPV5QERQATSRMBGE4YE63UHWGA7FHH4IYHZG7FIOQV5LLNGZNCI","accepted":true},"systemData":{"createdBy":"7fd08dcc-a653-4b0f-8f8c-4dac889fdda4","createdByType":"ManagedIdentity","createdAt":"2021-04-25T05:47:40.7464489+00:00","lastModifiedBy":"7fd08dcc-a653-4b0f-8f8c-4dac889fdda4","lastModifiedByType":"ManagedIdentity","lastModifiedAt":"2021-04-25T05:47:40.7464489+00:00"}}
ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @prbansa.

Issue Details
API: https://github.com/Azure/azure-rest-api-specs/blob/master/specification/marketplaceordering/resource-manager/Microsoft.MarketplaceOrdering/stable/2021-01-01/Agreements.json#L81 Request body : [AgreementTerms](https://github.com/Azure/azure-rest-api-specs/blob/master/specification/marketplaceordering/resource-manager/Microsoft.MarketplaceOrdering/stable/2021-01-01/Agreements.json#L384) , has property [AgreementTermsProperties](https://github.com/Azure/azure-rest-api-specs/blob/master/specification/marketplaceordering/resource-manager/Microsoft.MarketplaceOrdering/stable/2021-01-01/Agreements.json#L404-L439). Properties in AgreementTermsProperties aren't marked as required. - If those non-required properties not passed in in Rest Call, Rest will fail with 404 - If non-required properties passed in, Rest call will succeed. Below are sample Rest call request/response. Pls mark required properites as required. failed request/response ``` urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443 urllib3.connectionpool: https://management.azure.com:443 "PUT /subscriptions/ec0aa5f7-9e78-40c9-85cd-535c6305b380/providers/Microsoft.MarketplaceOrdering/offerTypes/virtualmachine/publishers/checkpoint/offers/vsec/plans/management/agreements/current?api-version=2021-01-01 HTTP/1.1" 404 225 cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: {"properties": {"publisher": "checkpoint", "product": "vsec", "plan": "management"}} cli.azure.cli.core.sdk.policies: Response status: 404 cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"error":{"code":"NotFound","message":"Unable to find legal terms for this offer. Agreement has never been signed for this offer. offer = 'vsec', sku = 'management', Correlation Id: '7a06656c-2dca-445c-8016-8fbfb251a43b'."}} ``` succeeded request/response ``` urllib3.connectionpool: https://management.azure.com:443 "PUT /subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/providers/Microsoft.MarketplaceOrdering/offerTypes/virtualmachine/publishers/checkpoint/offers/vsec/plans/management/agreements/current?api-version=2021-01-01 HTTP/1.1" 200 None request body: li.azure.cli.core.sdk.policies: {"properties": {"publisher": "checkpoint", "product": "vsec", "plan": "management", "licenseTextLink": "https://mpcprodsa.blob.core.windows.net/legalterms/3E5ED_legalterms_CHECKPOINT%253a24VSEC%253a24MANAGEMENT%253a2476HGNZSJREVLUQYE5WCZFRGIHF7HY2INZQW36Z5VLZ34BDJPP7742LAWDYIF7LIYDIM6RP55RIPRVIMZEOQWM6JL7YU7AD32MLUPYWY.txt", "privacyPolicyLink": "http://www.checkpoint.com/privacy", "marketplaceTermsLink": "https://mpcprodsa.blob.core.windows.net/marketplaceterms/3EDEF_marketplaceterms_AZUREAPPLICATION%253a24OF7TIMHFEMPZHRBYEO3SVLC7Q2MPXXAASJ5BO2FUY4UC6EZCN5TIL2KIGTA7WI2CSM3WV4L7QMPNRYPE2I7BOCM34RGOL3XTC6ADIMI.txt", "retrieveDatetime": "2021-04-25T05:47:39.5519164Z", "signature": "FM6IKWRFCMSMISDJRE2UEPNALT3AGR5IWDIZB22C6U2U3QJXVHY6DPV5QERQATSRMBGE4YE63UHWGA7FHH4IYHZG7FIOQV5LLNGZNCI", "accepted": true}} cli.azure.cli.core.sdk.policies: Response status: 200 cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"id":"/subscriptions/7fd08dcc-a653-4b0f-8f8c-4dac889fdda4/providers/Microsoft.MarketplaceOrdering/offerTypes/Microsoft.MarketplaceOrdering/offertypes/publishers/checkpoint/offers/vsec/plans/management/agreements/current","name":"management","type":"Microsoft.MarketplaceOrdering/offertypes","properties":{"publisher":"checkpoint","product":"vsec","plan":"management","licenseTextLink":"https://mpcprodsa.blob.core.windows.net/legalterms/3E5ED_legalterms_CHECKPOINT%253a24VSEC%253a24MANAGEMENT%253a2476HGNZSJREVLUQYE5WCZFRGIHF7HY2INZQW36Z5VLZ34BDJPP7742LAWDYIF7LIYDIM6RP55RIPRVIMZEOQWM6JL7YU7AD32MLUPYWY.txt","privacyPolicyLink":"http://www.checkpoint.com/privacy","marketplaceTermsLink":"https://mpcprodsa.blob.core.windows.net/marketplaceterms/3EDEF_marketplaceterms_AZUREAPPLICATION%253a24OF7TIMHFEMPZHRBYEO3SVLC7Q2MPXXAASJ5BO2FUY4UC6EZCN5TIL2KIGTA7WI2CSM3WV4L7QMPNRYPE2I7BOCM34RGOL3XTC6ADIMI.txt","retrieveDatetime":"2021-04-25T05:47:39.5519164Z","signature":"FM6IKWRFCMSMISDJRE2UEPNALT3AGR5IWDIZB22C6U2U3QJXVHY6DPV5QERQATSRMBGE4YE63UHWGA7FHH4IYHZG7FIOQV5LLNGZNCI","accepted":true},"systemData":{"createdBy":"7fd08dcc-a653-4b0f-8f8c-4dac889fdda4","createdByType":"ManagedIdentity","createdAt":"2021-04-25T05:47:40.7464489+00:00","lastModifiedBy":"7fd08dcc-a653-4b0f-8f8c-4dac889fdda4","lastModifiedByType":"ManagedIdentity","lastModifiedAt":"2021-04-25T05:47:40.7464489+00:00"}} ```
Author: yungezz
Assignees: jianyexi
Labels: `Marketplace Ordering`, `Service Attention`, `needs-triage`
Milestone: -