-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Update dynatrace CLI description and mark fields as required #8745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kairu-ms
merged 3 commits into
Azure:main
from
shivansh257:users/agarwalshiv/Dynatrace/descriptionUpdate
May 21, 2025
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,16 +15,16 @@ | |
| "dynatrace monitor create", | ||
| ) | ||
| class Create(AAZCommand): | ||
| """Create a monitor resource | ||
| """Create a Dynatrace resource on Azure for monitoring and observability needs. | ||
|
|
||
| :example: Create a monitor | ||
| 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']}}" | ||
| """ | ||
|
|
||
| _aaz_info = { | ||
| "version": "2021-09-01", | ||
| "version": "2023-04-27", | ||
| "resources": [ | ||
| ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/dynatrace.observability/monitors/{}", "2021-09-01"], | ||
| ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/dynatrace.observability/monitors/{}", "2023-04-27"], | ||
| ] | ||
| } | ||
|
|
||
|
|
@@ -78,11 +78,13 @@ def _build_arguments_schema(cls, *args, **kwargs): | |
| options=["--plan-data"], | ||
| arg_group="Properties", | ||
| help="Billing plan information.", | ||
| required=True, | ||
| ) | ||
| _args_schema.user_info = AAZObjectArg( | ||
| options=["--user-info"], | ||
| arg_group="Properties", | ||
| help="User info.", | ||
| required=True, | ||
| ) | ||
|
|
||
| environment = cls._args_schema.environment | ||
|
|
@@ -157,18 +159,22 @@ def _build_arguments_schema(cls, *args, **kwargs): | |
| plan_data.billing_cycle = AAZStrArg( | ||
| options=["billing-cycle"], | ||
| help="different billing cycles like MONTHLY/WEEKLY. this could be enum", | ||
| required=True, | ||
| ) | ||
| plan_data.effective_date = AAZDateTimeArg( | ||
| options=["effective-date"], | ||
| help="date when plan was applied", | ||
| required=True, | ||
| ) | ||
| plan_data.plan_details = AAZStrArg( | ||
| options=["plan-details"], | ||
| help="plan id as published by Dynatrace", | ||
| required=True, | ||
| ) | ||
| plan_data.usage_type = AAZStrArg( | ||
| options=["usage-type"], | ||
| help="different usage type like PAYG/COMMITTED. this could be enum", | ||
| required=True, | ||
| ) | ||
|
|
||
| user_info = cls._args_schema.user_info | ||
|
|
@@ -179,17 +185,20 @@ def _build_arguments_schema(cls, *args, **kwargs): | |
| user_info.email_address = AAZStrArg( | ||
| options=["email-address"], | ||
| help="Email of the user used by Dynatrace for contacting them if needed", | ||
| required=True, | ||
| fmt=AAZStrArgFormat( | ||
| pattern="^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$", | ||
| ), | ||
| ) | ||
| user_info.first_name = AAZStrArg( | ||
| options=["first-name"], | ||
| help="First Name of the user", | ||
| required=True, | ||
| ) | ||
| user_info.last_name = AAZStrArg( | ||
| options=["last-name"], | ||
| help="Last Name of the user", | ||
| required=True, | ||
| ) | ||
| user_info.phone_number = AAZStrArg( | ||
| options=["phone-number"], | ||
|
|
@@ -333,7 +342,7 @@ def url_parameters(self): | |
| def query_parameters(self): | ||
| parameters = { | ||
| **self.serialize_query_param( | ||
| "api-version", "2021-09-01", | ||
| "api-version", "2023-04-27", | ||
| required=True, | ||
| ), | ||
| } | ||
|
|
@@ -358,7 +367,7 @@ def content(self): | |
| typ=AAZObjectType, | ||
| typ_kwargs={"flags": {"required": True, "client_flatten": True}} | ||
| ) | ||
| _builder.set_prop("identity", AAZObjectType, ".identity") | ||
| _builder.set_prop("identity", AAZIdentityObjectType, ".identity") | ||
| _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}}) | ||
| _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) | ||
| _builder.set_prop("tags", AAZDictType, ".tags") | ||
|
|
@@ -382,8 +391,8 @@ def content(self): | |
| properties.set_prop("dynatraceEnvironmentProperties", AAZObjectType, ".environment") | ||
| properties.set_prop("marketplaceSubscriptionStatus", AAZStrType, ".subscription_status") | ||
| properties.set_prop("monitoringStatus", AAZStrType, ".monitoring_status") | ||
| properties.set_prop("planData", AAZObjectType, ".plan_data") | ||
| properties.set_prop("userInfo", AAZObjectType, ".user_info") | ||
| properties.set_prop("planData", AAZObjectType, ".plan_data", typ_kwargs={"flags": {"required": True}}) | ||
| properties.set_prop("userInfo", AAZObjectType, ".user_info", typ_kwargs={"flags": {"required": True}}) | ||
|
|
||
| dynatrace_environment_properties = _builder.get(".properties.dynatraceEnvironmentProperties") | ||
| if dynatrace_environment_properties is not None: | ||
|
|
@@ -417,17 +426,17 @@ def content(self): | |
|
|
||
| plan_data = _builder.get(".properties.planData") | ||
| if plan_data is not None: | ||
| plan_data.set_prop("billingCycle", AAZStrType, ".billing_cycle") | ||
| plan_data.set_prop("effectiveDate", AAZStrType, ".effective_date") | ||
| plan_data.set_prop("planDetails", AAZStrType, ".plan_details") | ||
| plan_data.set_prop("usageType", AAZStrType, ".usage_type") | ||
| plan_data.set_prop("billingCycle", AAZStrType, ".billing_cycle", typ_kwargs={"flags": {"required": True}}) | ||
| plan_data.set_prop("effectiveDate", AAZStrType, ".effective_date", typ_kwargs={"flags": {"required": True}}) | ||
| plan_data.set_prop("planDetails", AAZStrType, ".plan_details", typ_kwargs={"flags": {"required": True}}) | ||
| plan_data.set_prop("usageType", AAZStrType, ".usage_type", typ_kwargs={"flags": {"required": True}}) | ||
|
|
||
| user_info = _builder.get(".properties.userInfo") | ||
| if user_info is not None: | ||
| user_info.set_prop("country", AAZStrType, ".country") | ||
| user_info.set_prop("emailAddress", AAZStrType, ".email_address") | ||
| user_info.set_prop("firstName", AAZStrType, ".first_name") | ||
| user_info.set_prop("lastName", AAZStrType, ".last_name") | ||
| user_info.set_prop("emailAddress", AAZStrType, ".email_address", typ_kwargs={"flags": {"required": True}}) | ||
| user_info.set_prop("firstName", AAZStrType, ".first_name", typ_kwargs={"flags": {"required": True}}) | ||
| user_info.set_prop("lastName", AAZStrType, ".last_name", typ_kwargs={"flags": {"required": True}}) | ||
| user_info.set_prop("phoneNumber", AAZStrType, ".phone_number") | ||
|
|
||
| tags = _builder.get(".tags") | ||
|
|
@@ -457,7 +466,7 @@ def _build_schema_on_200_201(cls): | |
| _schema_on_200_201.id = AAZStrType( | ||
| flags={"read_only": True}, | ||
| ) | ||
| _schema_on_200_201.identity = AAZObjectType() | ||
| _schema_on_200_201.identity = AAZIdentityObjectType() | ||
| _schema_on_200_201.location = AAZStrType( | ||
| flags={"required": True}, | ||
| ) | ||
|
|
@@ -511,6 +520,7 @@ def _build_schema_on_200_201(cls): | |
| ) | ||
| properties.liftr_resource_category = AAZStrType( | ||
| serialized_name="liftrResourceCategory", | ||
| flags={"read_only": True}, | ||
| ) | ||
| properties.liftr_resource_preference = AAZIntType( | ||
| serialized_name="liftrResourcePreference", | ||
|
|
@@ -524,12 +534,15 @@ def _build_schema_on_200_201(cls): | |
| ) | ||
| properties.plan_data = AAZObjectType( | ||
| serialized_name="planData", | ||
| flags={"required": True}, | ||
| ) | ||
| properties.provisioning_state = AAZStrType( | ||
| serialized_name="provisioningState", | ||
| flags={"read_only": True}, | ||
| ) | ||
| properties.user_info = AAZObjectType( | ||
| serialized_name="userInfo", | ||
| flags={"required": True}, | ||
| ) | ||
|
|
||
| dynatrace_environment_properties = cls._schema_on_200_201.properties.dynatrace_environment_properties | ||
|
|
@@ -577,6 +590,7 @@ def _build_schema_on_200_201(cls): | |
| ) | ||
| single_sign_on_properties.provisioning_state = AAZStrType( | ||
| serialized_name="provisioningState", | ||
| flags={"read_only": True}, | ||
| ) | ||
| single_sign_on_properties.single_sign_on_state = AAZStrType( | ||
| serialized_name="singleSignOnState", | ||
|
|
@@ -591,27 +605,34 @@ def _build_schema_on_200_201(cls): | |
| plan_data = cls._schema_on_200_201.properties.plan_data | ||
| plan_data.billing_cycle = AAZStrType( | ||
| serialized_name="billingCycle", | ||
| flags={"required": True}, | ||
| ) | ||
| plan_data.effective_date = AAZStrType( | ||
| serialized_name="effectiveDate", | ||
| flags={"required": True}, | ||
| ) | ||
| plan_data.plan_details = AAZStrType( | ||
| serialized_name="planDetails", | ||
| flags={"required": True}, | ||
| ) | ||
| plan_data.usage_type = AAZStrType( | ||
| serialized_name="usageType", | ||
| flags={"required": True}, | ||
| ) | ||
|
|
||
| user_info = cls._schema_on_200_201.properties.user_info | ||
| user_info.country = AAZStrType() | ||
| user_info.email_address = AAZStrType( | ||
| serialized_name="emailAddress", | ||
| flags={"required": True}, | ||
| ) | ||
| user_info.first_name = AAZStrType( | ||
| serialized_name="firstName", | ||
| flags={"required": True}, | ||
| ) | ||
| user_info.last_name = AAZStrType( | ||
| serialized_name="lastName", | ||
| flags={"required": True}, | ||
| ) | ||
| user_info.phone_number = AAZStrType( | ||
| serialized_name="phoneNumber", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ | |
| "dynatrace monitor get-sso-detail", | ||
| ) | ||
| class GetSsoDetail(AAZCommand): | ||
| """Get the SSO configuration details from the partner | ||
| """Get the SSO configuration details for Dynatrace resource. | ||
|
|
||
| :example: Get-sso-detail | ||
| az dynatrace monitor get-sso-detail -g rg --monitor-name monitor --user-principal [email protected] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ | |
| "dynatrace monitor get-vm-host-payload", | ||
| ) | ||
| class GetVmHostPayload(AAZCommand): | ||
| """Return the payload that need to be passed in the request body for installing Dynatrace agent on a VM | ||
| """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. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we pass a payload in the API, is this backend API? Is it used for automated deployments of agents? |
||
|
|
||
| :example: Get-vm-host-payload | ||
| az dynatrace monitor get-vm-host-payload -g rg --monitor-name monitor | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ | |
| "dynatrace monitor list-linkable-environment", | ||
| ) | ||
| class ListLinkableEnvironment(AAZCommand): | ||
| """Get all the dynatrace environments that a user can link a azure resource to | ||
| """List all available Dynatrace environments that can be integrated with your Azure Dynatrace resources. | ||
|
|
||
| :example: List-linkable-environment | ||
| az dynatrace monitor list-linkable-environment -g rg --monitor-name monitor --user-principal [email protected] --region eastus2euap | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it required?