Skip to content
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

[MySQL] az mysql flexible-server maintenance: New command group for managing maintenance of MySQL flexible server #29505

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

Xiaoy666
Copy link
Contributor

Related command
az mysql flexible-server maintenance show
az mysql flexible-server maintenance list
az mysql flexible-server maintenance reschedule

Description
Add az command group 'az mysql flexible-server maintenance' which contains above three az commands. These commands will support customers to manage their maintenance on Azure MySQL flexible servers.

Testing Guide
az mysql flexible-server maintenance show --resource-group testgroup --server-name testserver --maintenance-name _T9Q-TS8
explanation: Get a maintenance of mysql flexible server 'testserver' under resource group 'testgroup', with maintenance name '_T9Q-TS8'

az mysql flexible-server maintenance list --resource-group testgroup --server-name testserver
explanation: List all of the maintenances of mysql flexible server 'testserver' under resource group 'testgroup'.

az mysql flexible-server maintenance reschedule --resource-group testgroup --server-name testserver --maintenance-name _T9Q-TS8 --start-time 2024-06-01T09:00:00Z
explanation: reschedule an existing maintenance '_T9Q-TS8' of the server 'testserver' under resource gruop 'testgroup' to a new start time 'UTC 20240601

@Xiaoy666 Xiaoy666 requested a review from evelyn-ys as a code owner July 29, 2024 05:57
Copy link

azure-client-tools-bot-prd bot commented Jul 29, 2024

🔄AzureCLI-FullTest
️✔️acr
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
🔄acs
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
🔄latest
️✔️3.11
🔄3.9
️✔️advisor
️✔️latest
️✔️3.11
️✔️3.9
️✔️ams
️✔️latest
️✔️3.11
️✔️3.9
️✔️apim
️✔️latest
️✔️3.11
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.11
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.11
️✔️3.9
️✔️aro
️✔️latest
️✔️3.11
️✔️3.9
️✔️backup
️✔️latest
️✔️3.11
️✔️3.9
️✔️batch
️✔️latest
️✔️3.11
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.11
️✔️3.9
️✔️billing
️✔️latest
️✔️3.11
️✔️3.9
🔄botservice
🔄latest
️✔️3.11
🔄3.9
️✔️cdn
️✔️latest
️✔️3.11
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.11
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.11
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.11
️✔️3.9
️✔️config
️✔️latest
️✔️3.11
️✔️3.9
️✔️configure
️✔️latest
️✔️3.11
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.11
️✔️3.9
️✔️container
️✔️latest
️✔️3.11
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.11
️✔️3.9
️✔️core
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
🔄cosmosdb
🔄latest
️✔️3.11
🔄3.9
️✔️databoxedge
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️dla
️✔️latest
️✔️3.11
️✔️3.9
️✔️dls
️✔️latest
️✔️3.11
️✔️3.9
️✔️dms
️✔️latest
️✔️3.11
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.11
️✔️3.9
🔄eventhubs
🔄latest
️✔️3.11
🔄3.9
️✔️feedback
️✔️latest
️✔️3.11
️✔️3.9
️✔️find
️✔️latest
️✔️3.11
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.11
️✔️3.9
️✔️identity
️✔️latest
️✔️3.11
️✔️3.9
️✔️iot
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
🔄keyvault
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
🔄latest
️✔️3.11
🔄3.9
️✔️kusto
️✔️latest
️✔️3.11
️✔️3.9
️✔️lab
️✔️latest
️✔️3.11
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.11
️✔️3.9
️✔️maps
️✔️latest
️✔️3.11
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.11
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.11
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.11
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.11
️✔️3.9
️✔️network
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.11
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.11
️✔️3.9
️✔️profile
️✔️latest
️✔️3.11
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.11
️✔️3.9
️✔️redis
️✔️latest
️✔️3.11
️✔️3.9
🔄relay
🔄latest
️✔️3.11
🔄3.9
️✔️resource
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️role
️✔️latest
️✔️3.11
️✔️3.9
🔄search
🔄latest
️✔️3.11
🔄3.9
️✔️security
️✔️latest
️✔️3.11
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.11
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.11
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.11
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.11
️✔️3.9
️✔️sql
️✔️latest
️✔️3.11
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.11
️✔️3.9
🔄storage
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
🔄latest
️✔️3.11
🔄3.9
️✔️synapse
️✔️latest
️✔️3.11
️✔️3.9
️✔️telemetry
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9
️✔️util
️✔️latest
️✔️3.11
️✔️3.9
️✔️vm
️✔️2018-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.11
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.11
️✔️3.9
️✔️latest
️✔️3.11
️✔️3.9

Copy link

Hi @Xiaoy666,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

Copy link

azure-client-tools-bot-prd bot commented Jul 29, 2024

⚠️AzureCLI-BreakingChangeTest
⚠️mysql
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd mysql flexible-server maintenance sub group mysql flexible-server maintenance added

@yonzhan
Copy link
Collaborator

yonzhan commented Jul 29, 2024

MySQL

@Xiaoy666
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@Xiaoy666 Xiaoy666 closed this Jul 30, 2024
@Xiaoy666 Xiaoy666 reopened this Jul 30, 2024
@evelyn-ys evelyn-ys changed the title [MySQL] Add az mysql flexible-server maintenance command group for managing maintenance of MySQL flexible server [MySQL] az mysql flexible-server maintenance: New command group for managing maintenance of MySQL flexible server Jul 30, 2024
with self.argument_context('mysql flexible-server maintenance reschedule') as c:
c.argument('resource_group_name', arg_type=resource_group_name_type, help='Resource Group Name of the server.')
c.argument('server_name', options_list=['--server-name', '-s'], help='The name of the server.')
c.argument('maintenance_name', options_list=['--maintenance-name', '-m'], help='The name of the maintenance.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this enumeration?

c.argument('resource_group_name', arg_type=resource_group_name_type, help='Resource Group Name of the server.')
c.argument('server_name', options_list=['--server-name', '-s'], help='The name of the server.')
c.argument('maintenance_name', options_list=['--maintenance-name', '-m'], help='The name of the maintenance.')
c.argument('maintenance_start_time', arg_type=maintenance_reschedule_time_arg_type, help='The new start time of the rescheduled maintenance.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need add validator for date format. If cannot add here, please add to custom.py

@@ -588,6 +595,21 @@ def load_arguments(self, _): # pylint: disable=too-many-statements, too-many-
with self.argument_context('mysql flexible-server identity show') as c:
c.argument('identity', options_list=['--identity', '-n'], help='Name or ID of identity to show.', validator=validate_identity)

with self.argument_context('mysql flexible-server maintenance reschedule') as c:
c.argument('resource_group_name', arg_type=resource_group_name_type, help='Resource Group Name of the server.')
c.argument('server_name', options_list=['--server-name', '-s'], help='The name of the server.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't need to check other attributes for server besides existence, I think we can skip server name validate here and make sure backend will check.

Comment on lines +1194 to +1199
def flexible_server_maintenance_list(client, resource_group_name, server_name):
return client.list(resource_group_name=resource_group_name, server_name=server_name)


def flexible_server_maintenance_show(client, resource_group_name, server_name, maintenance_name):
return client.read(resource_group_name=resource_group_name, server_name=server_name, maintenance_name=maintenance_name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's no custom logic, you don't need to define custom_command with custom func, just use command to call SDK function directly

@evelyn-ys evelyn-ys merged commit c3a19f7 into Azure:dev Aug 20, 2024
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants