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

[Rest] Make --method -m optional #11843

Merged
merged 1 commit into from
Jan 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2011,7 +2011,7 @@ def list_resource_links(cmd, scope=None, filter_string=None):
# endregion


def rest_call(cmd, method, uri, headers=None, uri_parameters=None,
def rest_call(cmd, uri, method=None, headers=None, uri_parameters=None,
Copy link
Member

@qwordy qwordy Jan 14, 2020

Choose a reason for hiding this comment

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

  1. Why you swap the order?
  2. Why not use method='get'?

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. Python requires non-default params to appear first
  2. This 'get' will be overridden by
    c.argument('method', options_list=['--method', '-m'], arg_type=get_enum_type(['head', 'get', 'put', 'post', 'delete', 'options', 'patch'], default='get'),

Copy link
Member

Choose a reason for hiding this comment

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

reasonable

body=None, skip_authorization_header=False, resource=None, output_file=None):
from azure.cli.core.util import send_raw_request
r = send_raw_request(cmd.cli_ctx, method, uri, headers, uri_parameters, body,
Expand Down