@@ -25,6 +25,14 @@ class Create(AAZCommand):
2525 --organization-profile "azure-dev-ops={organizations:[{url:'https://dev.azure.com/test-org',parallelism:2}],permissionProfile:{kind:'CreatorOnly'}}"
2626 --devcenter-project-resource-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.DevCenter/projects/contoso-proj"
2727 --fabric-profile "vmss={sku:{name:Standard_D2ads_v5},storageProfile:{osDiskStorageAccountType:Standard},images:[{resourceId:'/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus2/Publishers/canonical/ArtifactTypes/VMImage/Offers/0001-com-ubuntu-server-focal/Skus/20_04-lts-gen2/versions/latest',buffer:*}],osProfile:{secretsManagementSettings:{observedCertificates:[],keyExportable:false},logonType:Service}}"
28+
29+ :example: Create with agent profile resource predictions
30+ az mdp pool create --location "eastus" --name "cli-contoso-pool" --resource-group "rg1"
31+ --maximum-concurrency 3
32+ --agent-profile "{Stateless:{},resourcePredictionsProfile:{Manual:{}},resourcePredictions:{timezone:'UTC',daysData:[{},{},{},{'09:00:00':2,'11:00:00':0},{},{},{}]}}"
33+ --organization-profile "azure-dev-ops={organizations:[{url:'https://dev.azure.com/test-org',parallelism:2}],permissionProfile:{kind:'CreatorOnly'}}"
34+ --devcenter-project-resource-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.DevCenter/projects/contoso-proj"
35+ --fabric-profile "vmss={sku:{name:Standard_D2ads_v5},storageProfile:{osDiskStorageAccountType:Standard},images:[{resourceId:'/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus2/Publishers/canonical/ArtifactTypes/VMImage/Offers/0001-com-ubuntu-server-focal/Skus/20_04-lts-gen2/versions/latest',buffer:*}],osProfile:{secretsManagementSettings:{observedCertificates:[],keyExportable:false},logonType:Service}}"
2836 """
2937
3038 _aaz_info = {
@@ -140,6 +148,25 @@ def _build_arguments_schema(cls, *args, **kwargs):
140148 enum = {"Balanced" : "Balanced" , "BestPerformance" : "BestPerformance" , "MoreCostEffective" : "MoreCostEffective" , "MorePerformance" : "MorePerformance" , "MostCostEffective" : "MostCostEffective" },
141149 )
142150
151+ resource_predictions = cls ._args_schema .agent_profile .resource_predictions
152+ resource_predictions .timezone = AAZStrArg (
153+ options = ["timezone" , "timeZone" ],
154+ help = "Time zone of the predictive pool provisioning." ,
155+ )
156+
157+ resource_predictions .days_data = AAZListArg (
158+ options = ["days-data" ],
159+ help = "Resource predictions data per every day in a week." ,
160+ )
161+
162+ days_data = cls ._args_schema .agent_profile .resource_predictions .days_data
163+ days_data .Element = AAZDictArg (
164+ help = "key value pairs with time and predicted count"
165+ )
166+
167+ _element = cls ._args_schema .agent_profile .resource_predictions .days_data .Element
168+ _element .Element = AAZIntArg ()
169+
143170 fabric_profile = cls ._args_schema .fabric_profile
144171 fabric_profile .vmss = AAZObjectArg (
145172 options = ["vmss" ],
@@ -519,6 +546,19 @@ def content(self):
519546 resource_predictions_profile .discriminate_by ("kind" , "Automatic" )
520547 resource_predictions_profile .discriminate_by ("kind" , "Manual" )
521548
549+ resource_predictions = _builder .get (".properties.agentProfile.resourcePredictions" )
550+ if resource_predictions is not None :
551+ resource_predictions .set_prop ("timeZone" , AAZStrType , ".timezone" )
552+ resource_predictions .set_prop ("daysData" , AAZListType , ".days_data" )
553+
554+ days_data = _builder .get (".properties.agentProfile.resourcePredictions.daysData" )
555+ if days_data is not None :
556+ days_data .set_elements (AAZDictType , "." )
557+
558+ _elements = _builder .get (".properties.agentProfile.resourcePredictions.daysData[]" )
559+ if _elements is not None :
560+ _elements .set_elements (AAZIntType , "." )
561+
522562 disc_automatic = _builder .get (".properties.agentProfile.resourcePredictionsProfile{kind:Automatic}" )
523563 if disc_automatic is not None :
524564 disc_automatic .set_prop ("predictionPreference" , AAZStrType , ".automatic.prediction_preference" )
@@ -782,6 +822,21 @@ def _build_schema_on_200_201(cls):
782822 serialized_name = "maxAgentLifetime" ,
783823 )
784824
825+ resource_predictions = cls ._schema_on_200_201 .properties .agent_profile .resource_predictions
826+ resource_predictions .timezone = AAZStrType (
827+ serialized_name = "timeZone" ,
828+ )
829+
830+ resource_predictions .days_data = AAZListType (
831+ serialized_name = "daysData" ,
832+ )
833+
834+ days_data = cls ._schema_on_200_201 .properties .agent_profile .resource_predictions .days_data
835+ days_data .Element = AAZDictType ()
836+
837+ _element = cls ._schema_on_200_201 .properties .agent_profile .resource_predictions .days_data .Element
838+ _element .Element = AAZIntType ()
839+
785840 fabric_profile = cls ._schema_on_200_201 .properties .fabric_profile
786841 fabric_profile .kind = AAZStrType (
787842 flags = {"required" : True },
0 commit comments