1515 "dynatrace monitor create" ,
1616)
1717class Create (AAZCommand ):
18- """Create a monitor resource
18+ """Create a Dynatrace resource on Azure for monitoring and observability needs.
1919
2020 :example: Create a monitor
2121 az dynatrace monitor create -g rg -n monitor --user-info "{first-name:Alice,last-name:Bobab,email-address:[email protected] ,phone-number:1234567890,country:US}" --plan-data "{usage-type:committed,billing-cycle:Monthly,plan-details:azureportalintegration_privatepreview@TIDhjdtn7tfnxcy,effective-date:2022-08-20}" --environment "{single-sign-on:{aad-domains:['abc']}}" 2222 """
2323
2424 _aaz_info = {
25- "version" : "2021-09-01 " ,
25+ "version" : "2023-04-27 " ,
2626 "resources" : [
27- ["mgmt-plane" , "/subscriptions/{}/resourcegroups/{}/providers/dynatrace.observability/monitors/{}" , "2021-09-01 " ],
27+ ["mgmt-plane" , "/subscriptions/{}/resourcegroups/{}/providers/dynatrace.observability/monitors/{}" , "2023-04-27 " ],
2828 ]
2929 }
3030
@@ -78,11 +78,13 @@ def _build_arguments_schema(cls, *args, **kwargs):
7878 options = ["--plan-data" ],
7979 arg_group = "Properties" ,
8080 help = "Billing plan information." ,
81+ required = True ,
8182 )
8283 _args_schema .user_info = AAZObjectArg (
8384 options = ["--user-info" ],
8485 arg_group = "Properties" ,
8586 help = "User info." ,
87+ required = True ,
8688 )
8789
8890 environment = cls ._args_schema .environment
@@ -157,18 +159,22 @@ def _build_arguments_schema(cls, *args, **kwargs):
157159 plan_data .billing_cycle = AAZStrArg (
158160 options = ["billing-cycle" ],
159161 help = "different billing cycles like MONTHLY/WEEKLY. this could be enum" ,
162+ required = True ,
160163 )
161164 plan_data .effective_date = AAZDateTimeArg (
162165 options = ["effective-date" ],
163166 help = "date when plan was applied" ,
167+ required = True ,
164168 )
165169 plan_data .plan_details = AAZStrArg (
166170 options = ["plan-details" ],
167171 help = "plan id as published by Dynatrace" ,
172+ required = True ,
168173 )
169174 plan_data .usage_type = AAZStrArg (
170175 options = ["usage-type" ],
171176 help = "different usage type like PAYG/COMMITTED. this could be enum" ,
177+ required = True ,
172178 )
173179
174180 user_info = cls ._args_schema .user_info
@@ -179,17 +185,20 @@ def _build_arguments_schema(cls, *args, **kwargs):
179185 user_info .email_address = AAZStrArg (
180186 options = ["email-address" ],
181187 help = "Email of the user used by Dynatrace for contacting them if needed" ,
188+ required = True ,
182189 fmt = AAZStrArgFormat (
183190 pattern = "^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\ .)+[A-Za-z]{2,}$" ,
184191 ),
185192 )
186193 user_info .first_name = AAZStrArg (
187194 options = ["first-name" ],
188195 help = "First Name of the user" ,
196+ required = True ,
189197 )
190198 user_info .last_name = AAZStrArg (
191199 options = ["last-name" ],
192200 help = "Last Name of the user" ,
201+ required = True ,
193202 )
194203 user_info .phone_number = AAZStrArg (
195204 options = ["phone-number" ],
@@ -333,7 +342,7 @@ def url_parameters(self):
333342 def query_parameters (self ):
334343 parameters = {
335344 ** self .serialize_query_param (
336- "api-version" , "2021-09-01 " ,
345+ "api-version" , "2023-04-27 " ,
337346 required = True ,
338347 ),
339348 }
@@ -358,7 +367,7 @@ def content(self):
358367 typ = AAZObjectType ,
359368 typ_kwargs = {"flags" : {"required" : True , "client_flatten" : True }}
360369 )
361- _builder .set_prop ("identity" , AAZObjectType , ".identity" )
370+ _builder .set_prop ("identity" , AAZIdentityObjectType , ".identity" )
362371 _builder .set_prop ("location" , AAZStrType , ".location" , typ_kwargs = {"flags" : {"required" : True }})
363372 _builder .set_prop ("properties" , AAZObjectType , "." , typ_kwargs = {"flags" : {"required" : True , "client_flatten" : True }})
364373 _builder .set_prop ("tags" , AAZDictType , ".tags" )
@@ -382,8 +391,8 @@ def content(self):
382391 properties .set_prop ("dynatraceEnvironmentProperties" , AAZObjectType , ".environment" )
383392 properties .set_prop ("marketplaceSubscriptionStatus" , AAZStrType , ".subscription_status" )
384393 properties .set_prop ("monitoringStatus" , AAZStrType , ".monitoring_status" )
385- properties .set_prop ("planData" , AAZObjectType , ".plan_data" )
386- properties .set_prop ("userInfo" , AAZObjectType , ".user_info" )
394+ properties .set_prop ("planData" , AAZObjectType , ".plan_data" , typ_kwargs = { "flags" : { "required" : True }} )
395+ properties .set_prop ("userInfo" , AAZObjectType , ".user_info" , typ_kwargs = { "flags" : { "required" : True }} )
387396
388397 dynatrace_environment_properties = _builder .get (".properties.dynatraceEnvironmentProperties" )
389398 if dynatrace_environment_properties is not None :
@@ -417,17 +426,17 @@ def content(self):
417426
418427 plan_data = _builder .get (".properties.planData" )
419428 if plan_data is not None :
420- plan_data .set_prop ("billingCycle" , AAZStrType , ".billing_cycle" )
421- plan_data .set_prop ("effectiveDate" , AAZStrType , ".effective_date" )
422- plan_data .set_prop ("planDetails" , AAZStrType , ".plan_details" )
423- plan_data .set_prop ("usageType" , AAZStrType , ".usage_type" )
429+ plan_data .set_prop ("billingCycle" , AAZStrType , ".billing_cycle" , typ_kwargs = { "flags" : { "required" : True }} )
430+ plan_data .set_prop ("effectiveDate" , AAZStrType , ".effective_date" , typ_kwargs = { "flags" : { "required" : True }} )
431+ plan_data .set_prop ("planDetails" , AAZStrType , ".plan_details" , typ_kwargs = { "flags" : { "required" : True }} )
432+ plan_data .set_prop ("usageType" , AAZStrType , ".usage_type" , typ_kwargs = { "flags" : { "required" : True }} )
424433
425434 user_info = _builder .get (".properties.userInfo" )
426435 if user_info is not None :
427436 user_info .set_prop ("country" , AAZStrType , ".country" )
428- user_info .set_prop ("emailAddress" , AAZStrType , ".email_address" )
429- user_info .set_prop ("firstName" , AAZStrType , ".first_name" )
430- user_info .set_prop ("lastName" , AAZStrType , ".last_name" )
437+ user_info .set_prop ("emailAddress" , AAZStrType , ".email_address" , typ_kwargs = { "flags" : { "required" : True }} )
438+ user_info .set_prop ("firstName" , AAZStrType , ".first_name" , typ_kwargs = { "flags" : { "required" : True }} )
439+ user_info .set_prop ("lastName" , AAZStrType , ".last_name" , typ_kwargs = { "flags" : { "required" : True }} )
431440 user_info .set_prop ("phoneNumber" , AAZStrType , ".phone_number" )
432441
433442 tags = _builder .get (".tags" )
@@ -457,7 +466,7 @@ def _build_schema_on_200_201(cls):
457466 _schema_on_200_201 .id = AAZStrType (
458467 flags = {"read_only" : True },
459468 )
460- _schema_on_200_201 .identity = AAZObjectType ()
469+ _schema_on_200_201 .identity = AAZIdentityObjectType ()
461470 _schema_on_200_201 .location = AAZStrType (
462471 flags = {"required" : True },
463472 )
@@ -511,6 +520,7 @@ def _build_schema_on_200_201(cls):
511520 )
512521 properties .liftr_resource_category = AAZStrType (
513522 serialized_name = "liftrResourceCategory" ,
523+ flags = {"read_only" : True },
514524 )
515525 properties .liftr_resource_preference = AAZIntType (
516526 serialized_name = "liftrResourcePreference" ,
@@ -524,12 +534,15 @@ def _build_schema_on_200_201(cls):
524534 )
525535 properties .plan_data = AAZObjectType (
526536 serialized_name = "planData" ,
537+ flags = {"required" : True },
527538 )
528539 properties .provisioning_state = AAZStrType (
529540 serialized_name = "provisioningState" ,
541+ flags = {"read_only" : True },
530542 )
531543 properties .user_info = AAZObjectType (
532544 serialized_name = "userInfo" ,
545+ flags = {"required" : True },
533546 )
534547
535548 dynatrace_environment_properties = cls ._schema_on_200_201 .properties .dynatrace_environment_properties
@@ -577,6 +590,7 @@ def _build_schema_on_200_201(cls):
577590 )
578591 single_sign_on_properties .provisioning_state = AAZStrType (
579592 serialized_name = "provisioningState" ,
593+ flags = {"read_only" : True },
580594 )
581595 single_sign_on_properties .single_sign_on_state = AAZStrType (
582596 serialized_name = "singleSignOnState" ,
@@ -591,27 +605,34 @@ def _build_schema_on_200_201(cls):
591605 plan_data = cls ._schema_on_200_201 .properties .plan_data
592606 plan_data .billing_cycle = AAZStrType (
593607 serialized_name = "billingCycle" ,
608+ flags = {"required" : True },
594609 )
595610 plan_data .effective_date = AAZStrType (
596611 serialized_name = "effectiveDate" ,
612+ flags = {"required" : True },
597613 )
598614 plan_data .plan_details = AAZStrType (
599615 serialized_name = "planDetails" ,
616+ flags = {"required" : True },
600617 )
601618 plan_data .usage_type = AAZStrType (
602619 serialized_name = "usageType" ,
620+ flags = {"required" : True },
603621 )
604622
605623 user_info = cls ._schema_on_200_201 .properties .user_info
606624 user_info .country = AAZStrType ()
607625 user_info .email_address = AAZStrType (
608626 serialized_name = "emailAddress" ,
627+ flags = {"required" : True },
609628 )
610629 user_info .first_name = AAZStrType (
611630 serialized_name = "firstName" ,
631+ flags = {"required" : True },
612632 )
613633 user_info .last_name = AAZStrType (
614634 serialized_name = "lastName" ,
635+ flags = {"required" : True },
615636 )
616637 user_info .phone_number = AAZStrType (
617638 serialized_name = "phoneNumber" ,
0 commit comments