Skip to content

Commit 814f9ef

Browse files
authored
Update ProviderHub CLI Support for Comma Separated Values (#8461)
* Update _create.py * Update _create.py * Update test_step_provider_registration_create.yaml * Update test_step_resource_type_registration_create.yaml * Update test_providerhub_scenario_updated.py * Add tests for provider registration and resource type registration update. * Remove pre_operations. * Remove enum from provider_type. * Remove enum from routing_type. * Remove pre_operations. * Update test_step_provider_registration_create.yaml * Update test_step_resource_type_registration_create.yaml * Add provider and resource type registration update test recordings.
1 parent b210aa7 commit 814f9ef

File tree

7 files changed

+288
-30
lines changed

7 files changed

+288
-30
lines changed

src/providerhub/azext_providerhub/aaz/latest/providerhub/provider_registration/_update.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
391391
_args_schema.provider_type = AAZStrArg(
392392
options=["--provider-type"],
393393
arg_group="Properties",
394-
help="The provider type.",
394+
help="The provider type. Provider type options are: AuthorizationFree, External, Hidden, Internal, LegacyRegistrationRequired, NotSpecified, RegistrationFree, TenantOnly. Select multiple with comma separated string.",
395395
nullable=True,
396-
enum={"AuthorizationFree": "AuthorizationFree", "External": "External", "Hidden": "Hidden", "Internal": "Internal", "LegacyRegistrationRequired": "LegacyRegistrationRequired", "NotSpecified": "NotSpecified", "RegistrationFree": "RegistrationFree", "TenantOnly": "TenantOnly"},
397396
)
398397
_args_schema.provider_version = AAZStrArg(
399398
options=["--provider-version"],

src/providerhub/azext_providerhub/aaz/latest/providerhub/resource_type_registration/_update.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
483483
_args_schema.routing_type = AAZStrArg(
484484
options=["--routing-type"],
485485
arg_group="Properties",
486-
help="The resource routing type.",
486+
help="The resource routing type. The options are: CascadeExtension, Default, Extension, Failover, Fanout, HostBased, LocationBased, ProxyOnly, Tenant. Select multiple with a comma separated string.",
487487
nullable=True,
488-
enum={"CascadeExtension": "CascadeExtension", "Default": "Default", "Extension": "Extension", "Failover": "Failover", "Fanout": "Fanout", "HostBased": "HostBased", "LocationBased": "LocationBased", "ProxyOnly": "ProxyOnly", "Tenant": "Tenant"},
489488
)
490489
_args_schema.service_tree_infos = AAZListArg(
491490
options=["--service-tree-infos"],

src/providerhub/azext_providerhub/tests/latest/recordings/test_step_provider_registration_create.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ interactions:
66
"Resource Provider Service as a Service", "incidentRoutingTeam": "RPaaS", "manifestOwners":
77
["SPARTA-PlatformServiceAdministrator"], "serviceTreeInfos": [{"componentId":
88
"d1b7d8ba-05e2-48e6-90d6-d781b99c6e69", "serviceId": "d1b7d8ba-05e2-48e6-90d6-d781b99c6e69"}]},
9-
"metadata": {"BypassManifestValidation": true}, "providerVersion": "2.0", "tokenAuthConfiguration":
10-
{"authenticationScheme": "PoP", "signedRequestScope": "ResourceUri"}}}'
9+
"metadata": {"BypassManifestValidation": true}, "providerType": "Hidden, Internal",
10+
"providerVersion": "2.0", "tokenAuthConfiguration": {"authenticationScheme":
11+
"PoP", "signedRequestScope": "ResourceUri"}}}'
1112
headers:
1213
Accept:
1314
- application/json
@@ -18,31 +19,31 @@ interactions:
1819
Connection:
1920
- keep-alive
2021
Content-Length:
21-
- '684'
22+
- '720'
2223
Content-Type:
2324
- application/json
2425
ParameterSetName:
2526
- --token-auth-configuration --service-tree-infos --capabilities --capabilities
2627
--manifest-owners --incident-contact-email --incident-routing-service --incident-routing-team
27-
--provider-version --provider-namespace --metadata
28+
--provider-version --provider-type --provider-namespace --metadata
2829
User-Agent:
29-
- AZURECLI/2.61.0 azsdk-python-core/1.28.0 Python/3.11.0 (Windows-10-10.0.22631-SP0)
30+
- AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.12.0 (Windows-11-10.0.26100-SP0)
3031
method: PUT
3132
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ProviderHub/providerRegistrations/Private.VPTest?api-version=2024-04-01-preview
3233
response:
3334
body:
3435
string: '{"properties":{"privateResourceProviderConfiguration":{"allowedSubscriptions":["81ddc363-4b54-4223-833d-16b2a424d8a0"]},"provisioningState":"Succeeded","namespace":"Private.VPTest","providerVersion":"2.0","providerType":"Internal,
3536
Hidden","management":{"manifestOwners":["SPARTA-PlatformServiceAdministrator"],"incidentRoutingService":"Resource
36-
Provider Service as a Service","incidentRoutingTeam":"RPaaS","incidentContactEmail":"[email protected]","serviceTreeInfos":[{"serviceId":"d1b7d8ba-05e2-48e6-90d6-d781b99c6e69","componentId":"d1b7d8ba-05e2-48e6-90d6-d781b99c6e69"}]},"capabilities":[{"quotaId":"CSP_2015-05-01","effect":"Allow"},{"quotaId":"CSP_MG_2017-12-01","effect":"Allow"}],"metadata":{"BypassManifestValidation":true},"tokenAuthConfiguration":{"authenticationScheme":"PoP","signedRequestScope":"ResourceUri","disableCertificateAuthenticationFallback":false}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ProviderHub/providerRegistrations/Private.VPTest","type":"Microsoft.ProviderHub/providerRegistrations","name":"Private.VPTest","kind":"Managed","systemData":{"createdBy":"[email protected]","createdByType":"User","createdAt":"2022-11-16T00:05:06.5154703Z","lastModifiedBy":"gaurimadhok@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2024-06-17T03:49:36.6182293Z"}}'
37+
Provider Service as a Service","incidentRoutingTeam":"RPaaS","incidentContactEmail":"[email protected]","serviceTreeInfos":[{"serviceId":"d1b7d8ba-05e2-48e6-90d6-d781b99c6e69","componentId":"d1b7d8ba-05e2-48e6-90d6-d781b99c6e69"}]},"capabilities":[{"quotaId":"CSP_2015-05-01","effect":"Allow"},{"quotaId":"CSP_MG_2017-12-01","effect":"Allow"}],"metadata":{"BypassManifestValidation":true},"tokenAuthConfiguration":{"authenticationScheme":"PoP","signedRequestScope":"ResourceUri","disableCertificateAuthenticationFallback":false}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ProviderHub/providerRegistrations/Private.VPTest","type":"Microsoft.ProviderHub/providerRegistrations","name":"Private.VPTest","kind":"Managed","systemData":{"createdBy":"[email protected]","createdByType":"User","createdAt":"2022-11-16T00:05:06.5154703Z","lastModifiedBy":"nataliezoz@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-02-25T00:16:37.5659306Z"}}'
3738
headers:
3839
cache-control:
3940
- no-cache
4041
content-length:
41-
- '1345'
42+
- '1344'
4243
content-type:
4344
- application/json; charset=utf-8
4445
date:
45-
- Mon, 17 Jun 2024 03:49:46 GMT
46+
- Tue, 25 Feb 2025 00:16:38 GMT
4647
expires:
4748
- '-1'
4849
pragma:
@@ -53,12 +54,12 @@ interactions:
5354
- CONFIG_NOCACHE
5455
x-content-type-options:
5556
- nosniff
56-
x-ms-operation-identifier:
57-
- tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=9506e7c0-c569-479f-9940-1f63cb8ce817/centraluseuap/295f3079-311a-4576-9769-bd2118a4720c
57+
x-ms-ratelimit-remaining-subscription-global-writes:
58+
- '11999'
5859
x-ms-ratelimit-remaining-subscription-writes:
59-
- '1197'
60+
- '799'
6061
x-msedge-ref:
61-
- 'Ref A: 6F6726D26FE84B3AB8B77DA8FE0CBD56 Ref B: CO6AA3150218035 Ref C: 2024-06-17T03:49:36Z'
62+
- 'Ref A: 3103F7BCF7A34BF3AC8D8FFF9F1BEC66 Ref B: CO6AA3150217035 Ref C: 2025-02-25T00:16:37Z'
6263
status:
6364
code: 200
6465
message: OK
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
Accept:
6+
- application/json
7+
Accept-Encoding:
8+
- gzip, deflate
9+
CommandName:
10+
- providerhub provider-registration update
11+
Connection:
12+
- keep-alive
13+
ParameterSetName:
14+
- --token-auth-configuration --service-tree-infos --capabilities --capabilities
15+
--manifest-owners --incident-contact-email --incident-routing-service --incident-routing-team
16+
--provider-version --provider-type --provider-namespace --metadata
17+
User-Agent:
18+
- AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.12.0 (Windows-11-10.0.26100-SP0)
19+
method: GET
20+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ProviderHub/providerRegistrations/Private.VPTest?api-version=2024-04-01-preview
21+
response:
22+
body:
23+
string: '{"properties":{"privateResourceProviderConfiguration":{"allowedSubscriptions":["81ddc363-4b54-4223-833d-16b2a424d8a0"]},"provisioningState":"Succeeded","namespace":"Private.VPTest","providerVersion":"2.0","providerType":"Hidden","management":{"manifestOwners":["SPARTA-PlatformServiceAdministrator"],"incidentRoutingService":"Resource
24+
Provider Service as a Service","incidentRoutingTeam":"RPaaS","incidentContactEmail":"[email protected]","serviceTreeInfos":[{"serviceId":"d1b7d8ba-05e2-48e6-90d6-d781b99c6e69","componentId":"d1b7d8ba-05e2-48e6-90d6-d781b99c6e69"}]},"capabilities":[{"quotaId":"CSP_2015-05-01","effect":"Allow"},{"quotaId":"CSP_MG_2017-12-01","effect":"Allow"}],"metadata":{"BypassManifestValidation":true},"tokenAuthConfiguration":{"authenticationScheme":"PoP","signedRequestScope":"ResourceUri","disableCertificateAuthenticationFallback":false}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ProviderHub/providerRegistrations/Private.VPTest","type":"Microsoft.ProviderHub/providerRegistrations","name":"Private.VPTest","kind":"Managed","systemData":{"createdBy":"[email protected]","createdByType":"User","createdAt":"2022-11-16T00:05:06.5154703Z","lastModifiedBy":"[email protected]","lastModifiedByType":"User","lastModifiedAt":"2025-02-24T23:56:21.4480278Z"}}'
25+
headers:
26+
cache-control:
27+
- no-cache
28+
content-length:
29+
- '1334'
30+
content-type:
31+
- application/json; charset=utf-8
32+
date:
33+
- Mon, 24 Feb 2025 23:57:57 GMT
34+
expires:
35+
- '-1'
36+
pragma:
37+
- no-cache
38+
strict-transport-security:
39+
- max-age=31536000; includeSubDomains
40+
x-cache:
41+
- CONFIG_NOCACHE
42+
x-content-type-options:
43+
- nosniff
44+
x-ms-ratelimit-remaining-subscription-global-reads:
45+
- '16499'
46+
x-msedge-ref:
47+
- 'Ref A: CF8693E8298B48EC818958BEBDD3858F Ref B: CO6AA3150218009 Ref C: 2025-02-24T23:57:57Z'
48+
status:
49+
code: 200
50+
message: OK
51+
- request:
52+
body: '{"kind": "Managed", "properties": {"capabilities": [{"effect": "Allow",
53+
"quotaId": "CSP_2015-05-01"}, {"effect": "Allow", "quotaId": "CSP_MG_2017-12-01"}],
54+
"management": {"incidentContactEmail": "[email protected]", "incidentRoutingService":
55+
"Resource Provider Service as a Service", "incidentRoutingTeam": "RPaaS", "manifestOwners":
56+
["SPARTA-PlatformServiceAdministrator"], "serviceTreeInfos": [{"componentId":
57+
"d1b7d8ba-05e2-48e6-90d6-d781b99c6e69", "serviceId": "d1b7d8ba-05e2-48e6-90d6-d781b99c6e69"}]},
58+
"metadata": {"BypassManifestValidation": true}, "namespace": "Private.VPTest",
59+
"privateResourceProviderConfiguration": {"allowedSubscriptions": ["81ddc363-4b54-4223-833d-16b2a424d8a0"]},
60+
"providerType": "Internal, Hidden", "providerVersion": "2.0", "tokenAuthConfiguration":
61+
{"authenticationScheme": "PoP", "disableCertificateAuthenticationFallback":
62+
false, "signedRequestScope": "ResourceUri"}}}'
63+
headers:
64+
Accept:
65+
- application/json
66+
Accept-Encoding:
67+
- gzip, deflate
68+
CommandName:
69+
- providerhub provider-registration update
70+
Connection:
71+
- keep-alive
72+
Content-Length:
73+
- '910'
74+
Content-Type:
75+
- application/json
76+
ParameterSetName:
77+
- --token-auth-configuration --service-tree-infos --capabilities --capabilities
78+
--manifest-owners --incident-contact-email --incident-routing-service --incident-routing-team
79+
--provider-version --provider-type --provider-namespace --metadata
80+
User-Agent:
81+
- AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.12.0 (Windows-11-10.0.26100-SP0)
82+
method: PUT
83+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ProviderHub/providerRegistrations/Private.VPTest?api-version=2024-04-01-preview
84+
response:
85+
body:
86+
string: '{"properties":{"privateResourceProviderConfiguration":{"allowedSubscriptions":["81ddc363-4b54-4223-833d-16b2a424d8a0"]},"provisioningState":"Succeeded","namespace":"Private.VPTest","providerVersion":"2.0","providerType":"Internal,
87+
Hidden","management":{"manifestOwners":["SPARTA-PlatformServiceAdministrator"],"incidentRoutingService":"Resource
88+
Provider Service as a Service","incidentRoutingTeam":"RPaaS","incidentContactEmail":"[email protected]","serviceTreeInfos":[{"serviceId":"d1b7d8ba-05e2-48e6-90d6-d781b99c6e69","componentId":"d1b7d8ba-05e2-48e6-90d6-d781b99c6e69"}]},"capabilities":[{"quotaId":"CSP_2015-05-01","effect":"Allow"},{"quotaId":"CSP_MG_2017-12-01","effect":"Allow"}],"metadata":{"BypassManifestValidation":true},"tokenAuthConfiguration":{"authenticationScheme":"PoP","signedRequestScope":"ResourceUri","disableCertificateAuthenticationFallback":false}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ProviderHub/providerRegistrations/Private.VPTest","type":"Microsoft.ProviderHub/providerRegistrations","name":"Private.VPTest","kind":"Managed","systemData":{"createdBy":"[email protected]","createdByType":"User","createdAt":"2022-11-16T00:05:06.5154703Z","lastModifiedBy":"[email protected]","lastModifiedByType":"User","lastModifiedAt":"2025-02-24T23:57:57.6563158Z"}}'
89+
headers:
90+
cache-control:
91+
- no-cache
92+
content-length:
93+
- '1344'
94+
content-type:
95+
- application/json; charset=utf-8
96+
date:
97+
- Mon, 24 Feb 2025 23:57:59 GMT
98+
expires:
99+
- '-1'
100+
pragma:
101+
- no-cache
102+
strict-transport-security:
103+
- max-age=31536000; includeSubDomains
104+
x-cache:
105+
- CONFIG_NOCACHE
106+
x-content-type-options:
107+
- nosniff
108+
x-ms-ratelimit-remaining-subscription-global-writes:
109+
- '11999'
110+
x-ms-ratelimit-remaining-subscription-writes:
111+
- '799'
112+
x-msedge-ref:
113+
- 'Ref A: 877F94E634134BE6A128A177121AA351 Ref B: CO6AA3150218009 Ref C: 2025-02-24T23:57:57Z'
114+
status:
115+
code: 200
116+
message: OK
117+
version: 1

src/providerhub/azext_providerhub/tests/latest/recordings/test_step_resource_type_registration_create.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
interactions:
22
- request:
33
body: '{"kind": "Managed", "properties": {"endpoints": [{"apiVersions": ["2019-01-01"],
4-
"locations": ["WestUS"]}], "regionality": "Regional"}}'
4+
"locations": ["WestUS"]}], "regionality": "Regional", "routingType": "ProxyOnly,
5+
Extension"}}'
56
headers:
67
Accept:
78
- application/json
@@ -12,27 +13,28 @@ interactions:
1213
Connection:
1314
- keep-alive
1415
Content-Length:
15-
- '135'
16+
- '174'
1617
Content-Type:
1718
- application/json
1819
ParameterSetName:
19-
- --endpoints --regionality --provider-namespace --resource-type
20+
- --endpoints --regionality --provider-namespace --resource-type --routing-type
2021
User-Agent:
21-
- AZURECLI/2.59.0 azsdk-python-core/1.28.0 Python/3.11.0 (Windows-10-10.0.22631-SP0)
22+
- AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.12.0 (Windows-11-10.0.26100-SP0)
2223
method: PUT
2324
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ProviderHub/providerRegistrations/Private.VPTest/resourcetypeRegistrations/extensionresourcetype?api-version=2024-04-01-preview
2425
response:
2526
body:
26-
string: '{"properties":{"name":"extensionresourcetype","routingType":"Default","regionality":"Regional","endpoints":[{"kind":"Managed","apiVersions":["2019-01-01"],"locations":["WestUS"]}],"defaultApiVersion":"2019-01-01","enableAsyncOperation":false,"provisioningState":"Succeeded","enableThirdPartyS2S":false,"templateDeploymentOptions":{"preflightSupported":true,"preflightOptions":["DefaultValidationOnly"]}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ProviderHub/providerRegistrations/Private.VPTest/resourceTypeRegistrations/extensionresourcetype","type":"Microsoft.ProviderHub/providerRegistrations/resourceTypeRegistrations","name":"extensionresourcetype","kind":"Managed","systemData":{"createdBy":"[email protected]","createdByType":"User","createdAt":"2024-05-31T03:23:33.5645757Z","lastModifiedBy":"[email protected]","lastModifiedByType":"User","lastModifiedAt":"2024-06-04T23:30:16.4751488Z"}}'
27+
string: '{"properties":{"name":"extensionresourcetype","routingType":"ProxyOnly,
28+
Extension","regionality":"Regional","endpoints":[{"kind":"Managed","apiVersions":["2019-01-01"],"locations":["WestUS"]}],"defaultApiVersion":"2019-01-01","throttlingRules":[{"action":"Private.VPTest/extensionresourcetype/write","metrics":[{"type":"NumberOfRequests","limit":400,"interval":"PT1H"}]},{"action":"Private.VPTest/extensionresourcetype/read","metrics":[{"type":"NumberOfRequests","limit":4000,"interval":"PT1H"}]},{"action":"Private.VPTest/extensionresourcetype/delete","metrics":[{"type":"NumberOfRequests","limit":5000,"interval":"PT1H"}]}],"enableAsyncOperation":false,"provisioningState":"Succeeded","enableThirdPartyS2S":false,"templateDeploymentOptions":{"preflightSupported":true,"preflightOptions":["DefaultValidationOnly"]}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ProviderHub/providerRegistrations/Private.VPTest/resourceTypeRegistrations/extensionresourcetype","type":"Microsoft.ProviderHub/providerRegistrations/resourceTypeRegistrations","name":"extensionresourcetype","kind":"Managed","systemData":{"createdBy":"[email protected]","createdByType":"User","createdAt":"2025-02-07T22:56:55.0029838Z","lastModifiedBy":"[email protected]","lastModifiedByType":"User","lastModifiedAt":"2025-02-25T01:02:30.5754252Z"}}'
2729
headers:
2830
cache-control:
2931
- no-cache
3032
content-length:
31-
- '949'
33+
- '1360'
3234
content-type:
3335
- application/json; charset=utf-8
3436
date:
35-
- Tue, 04 Jun 2024 23:30:21 GMT
37+
- Tue, 25 Feb 2025 01:02:31 GMT
3638
expires:
3739
- '-1'
3840
pragma:
@@ -43,12 +45,12 @@ interactions:
4345
- CONFIG_NOCACHE
4446
x-content-type-options:
4547
- nosniff
46-
x-ms-operation-identifier:
47-
- tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=9506e7c0-c569-479f-9940-1f63cb8ce817/centraluseuap/c2af90b9-43e4-42e1-89aa-e6284ab27de0
48+
x-ms-ratelimit-remaining-subscription-global-writes:
49+
- '11999'
4850
x-ms-ratelimit-remaining-subscription-writes:
49-
- '1197'
51+
- '799'
5052
x-msedge-ref:
51-
- 'Ref A: 8C557624C4F54E8380FDDB445379C9FA Ref B: DM2AA1091214017 Ref C: 2024-06-04T23:30:16Z'
53+
- 'Ref A: AC2A6F18AFAB4779B32457B8672752C0 Ref B: CO6AA3150217031 Ref C: 2025-02-25T01:02:30Z'
5254
status:
5355
code: 200
5456
message: OK

0 commit comments

Comments
 (0)