-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{APIM} migrate CLI to track2 #20982
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
{APIM} migrate CLI to track2 #20982
Conversation
|
track2 migration |
|
/azp run |
|
Pull request contains merge conflicts. |
|
@yingru97, please resolve the conflict first |
1f45a9d to
cddca6e
Compare
| query=subscription_key_query_param_name | ||
| ) | ||
| elif subscription_key_query_param_name is not None or subscription_key_header_name is not None: | ||
| raise CLIError( |
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.
Please use a more specific error type from azure.cli.core.azclierror import RequiredArgumentMissingError instead of the generic error CLIError.
BTW, please check other errors you used to see if they also need update error type. #Closed
|
@yingru97, Overall LGTM, just one minor suggestion, please check. |
| parameters.value = specification_url | ||
| elif specification_path is not None and specification_url is not None: | ||
| raise CLIError( | ||
| raise ArgumentUsageError( |
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.
Use MutuallyExclusiveArgumentError instead of ArgumentUsageError as (ArgumentUsageError is fallback of the argument usage related errors. Avoid using this class unless the error can not be classified into the Argument related specific error types.) #Closed
| "Can't specify specification-url and specification-path at the same time.") | ||
| else: | ||
| raise CLIError( | ||
| raise ArgumentUsageError( |
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.
Use RequiredArgumentMissingError #Closed
| query=subscription_key_query_param_name | ||
| ) | ||
| elif subscription_key_query_param_name is not None or subscription_key_header_name is not None: | ||
| raise ArgumentUsageError( |
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.
Use RequiredArgumentMissingError #Closed
| subscription_key_header_name, subscription_key_query_param_name) | ||
| resource.api_version = api_version | ||
| resource.api_version_set_id = _get_vs_fullpath(api_version_set_id) | ||
| raise InvalidArgumentValueError( |
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.
Miss importing "InvalidArgumentValueError" which makes CI failed, please fix it.
Description
Migrate APIM CLI to track2
Testing Guide
Use ApimScenarioTest to test it
History Notes
This checklist is used to make sure that common guidelines for a pull request are followed.
[ x] The PR title and description has followed the guideline in Submitting Pull Requests.
[ x] I adhere to the Command Guidelines.
[ x] I adhere to the Error Handling Guidelines.