Skip to content

Commit f5b41e8

Browse files
shivansh257Shivansh Agarwal
andauthored
Update dynatrace CLI description and mark fields as required (#8745)
* update dynatrace commands description * update release history * mark fields as required and update recordings --------- Co-authored-by: Shivansh Agarwal <[email protected]>
1 parent 6e304e2 commit f5b41e8

35 files changed

+691
-677
lines changed

src/dynatrace/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Release History
44
===============
55

6+
1.1.1
7+
++++++
8+
* Update the CLI command documentation
9+
610
1.1.0
711
++++++
812
* Add: metrics enabled flag while creating tag rule

src/dynatrace/azext_dynatrace/aaz/latest/dynatrace/_get_marketplace_saas_resource_detail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dynatrace get-marketplace-saas-resource-detail",
1616
)
1717
class GetMarketplaceSaasResourceDetail(AAZCommand):
18-
"""Get Marketplace SaaS resource details of a tenant under a specific subscription
18+
"""Get Marketplace SaaS resource details for a given tenant under a subscription.
1919
2020
:example: Monitors_GetMarketplaceSaaSResourceDetails_MaximumSet_Gen
2121
az dynatrace get-marketplace-saas-resource-detail --tenant-id urnmattojzhktcfw

src/dynatrace/azext_dynatrace/aaz/latest/dynatrace/monitor/__cmd_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dynatrace monitor",
1616
)
1717
class __CMDGroup(AAZCommandGroup):
18-
"""Manage dynatrace monitor
18+
"""Manage Dynatrace resource on Azure. This command lists properties including Dynatrace environment properties, SSO properties, and plan information.
1919
"""
2020
pass
2121

src/dynatrace/azext_dynatrace/aaz/latest/dynatrace/monitor/_create.py

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
"dynatrace monitor create",
1616
)
1717
class 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",

src/dynatrace/azext_dynatrace/aaz/latest/dynatrace/monitor/_delete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
confirmation="Are you sure you want to perform this operation?",
1717
)
1818
class Delete(AAZCommand):
19-
"""Delete a monitor resource
19+
"""Delete a Dynatrace resource.
2020
2121
:example: Delete a monitor
2222
az dynatrace monitor delete -n monitor -g rg -y

src/dynatrace/azext_dynatrace/aaz/latest/dynatrace/monitor/_get_metric_status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dynatrace monitor get-metric-status",
1616
)
1717
class GetMetricStatus(AAZCommand):
18-
"""Get metric status
18+
"""Get status of metrics being sent to the Dynatrace resource.
1919
2020
:example: Monitors_GetMetricStatus_MaximumSet_Gen
2121
az dynatrace monitor get-metric-status --resource-group rgDynatrace --monitor-name fhcjxnxumkdlgpwanewtkdnyuz

src/dynatrace/azext_dynatrace/aaz/latest/dynatrace/monitor/_get_sso_detail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dynatrace monitor get-sso-detail",
1616
)
1717
class GetSsoDetail(AAZCommand):
18-
"""Get the SSO configuration details from the partner
18+
"""Get the SSO configuration details for Dynatrace resource.
1919
2020
:example: Get-sso-detail
2121
az dynatrace monitor get-sso-detail -g rg --monitor-name monitor --user-principal [email protected]

src/dynatrace/azext_dynatrace/aaz/latest/dynatrace/monitor/_get_vm_host_payload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dynatrace monitor get-vm-host-payload",
1616
)
1717
class GetVmHostPayload(AAZCommand):
18-
"""Return the payload that need to be passed in the request body for installing Dynatrace agent on a VM
18+
"""Return payload to be included in API request body when installing Dynatrace agent on a Virtual Machine. Use this command to facilitate automated deployment of monitoring agents across VMs.
1919
2020
:example: Get-vm-host-payload
2121
az dynatrace monitor get-vm-host-payload -g rg --monitor-name monitor

src/dynatrace/azext_dynatrace/aaz/latest/dynatrace/monitor/_list.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dynatrace monitor list",
1616
)
1717
class List(AAZCommand):
18-
"""List all monitor resource by monitor name in a resource group
18+
"""List all MonitorResource by subscriptionId.
1919
2020
:example: List monitor
2121
az dynatrace monitor list -g rg --monitor-name monitor
@@ -159,7 +159,7 @@ def _build_schema_on_200(cls):
159159
_element.id = AAZStrType(
160160
flags={"read_only": True},
161161
)
162-
_element.identity = AAZObjectType()
162+
_element.identity = AAZIdentityObjectType()
163163
_element.location = AAZStrType(
164164
flags={"required": True},
165165
)

src/dynatrace/azext_dynatrace/aaz/latest/dynatrace/monitor/_list_app_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dynatrace monitor list-app-service",
1616
)
1717
class ListAppService(AAZCommand):
18-
"""Get list of app services with dynatrace PaaS OneAgent enabled
18+
"""List all App Services that have Dynatrace OneAgent installed.
1919
2020
:example: List-app-service
2121
az dynatrace monitor list-app-service -g rg --monitor-name monitor

0 commit comments

Comments
 (0)