-
Notifications
You must be signed in to change notification settings - Fork 3.3k
On-board Location Based Services #5716
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
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
418b2a1
Introduce LocationBasedServices command_module
jp94 8bbcd51
Introduce test cases for LocationBasedServices command_module
jp94 18d9384
[Refactor] Renamed lbs to locationbasedservices
jp94 cb738db
[Refactor] Renamed lbs to locationbasedservices
jp94 b74cb79
[Legal] Add the Preview Terms agreement requirement
jp94 409b03b
[Test] Add more strict assertion rule for key validation.
jp94 ed3ca01
[Test] Add test for tags parameter
jp94 81e4fb5
[Test] Added an additional resource group.
jp94 0d11a6d
[Test] Init recordings
jp94 87accc7
Merge remote-tracking branch 'upstream/dev' into dev
jp94 9e5051f
[Pylint] Specify string format arguments as logging function parameters
jp94 77a9f22
[Refactor] Update description in _help to match the general template
jp94 98d973e
[Refactor] General template mismatch fix for 'key'
jp94 5853331
[Feature] Introduce search by ids
jp94 4d930f8
[Temporary] Throw an exception on 'account show' command, when nonexist
jp94 d36abf9
[Test] 'account show' on non-existent account should not return empty.
jp94 b79cb10
[Feature] Introduce update command
jp94 75795e6
[Test] Add test for update and search by id
jp94 100df29
Merge remote-tracking branch 'upstream/dev' into dev
jp94 1fd7bef
[Refactor] Rename generic client (sync with updated Swagger)
jp94 1aee6b2
[Refactor] Use default SDK's function
jp94 35976e7
[Refactor] Remove Preview Terms & docs in custom.py
jp94 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
[Temporary] Throw an exception on 'account show' command, when nonexist
- Loading branch information
commit 4d930f80dc7505595e202bbd25c9710d0cf1afc5
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,11 +9,21 @@ | |
|
|
||
| from azure.mgmt.locationbasedservices.models import LocationBasedServicesAccountCreateParameters, Sku | ||
|
|
||
| ACCOUNT_LOCATION = 'global' | ||
|
|
||
| logger = get_logger(__name__) | ||
|
|
||
|
|
||
| # pylint: disable=line-too-long | ||
| def create(client, resource_group_name, account_name, sku_name='S0', tags=None, agree=None): | ||
| def get_account(client, resource_group_name, account_name): | ||
| response = client.get(resource_group_name, account_name) | ||
| if response is None: | ||
| raise CLIError("The resource 'Microsoft.LocationBasedServices/accounts/" + account_name + | ||
| "' under resource group '" + resource_group_name + "' was not found.") | ||
| return response | ||
|
|
||
|
|
||
| def create_account(client, resource_group_name, account_name, sku_name='S0', tags=None, agree=None): | ||
| """Create a Location Based Services Account. A Location Based | ||
| Services Account holds the keys which allow access to the Location | ||
| Based Services REST APIs. | ||
|
|
@@ -44,16 +54,16 @@ def create(client, resource_group_name, account_name, sku_name='S0', tags=None, | |
| warning_msg = 'By creating a Location Based Services account, you agree to the Microsoft Azure Preview Terms.' + \ | ||
| '\nThe Preview Terms can be found at: ' + \ | ||
| '\nhttps://azure.microsoft.com/en-us/support/legal/preview-supplemental-terms/' | ||
|
|
||
| logger.warning(warning_msg) | ||
| if not agree: # ... in order to pass tests | ||
|
|
||
| if not agree: # ... in order to pass ScenarioTest | ||
| response = prompt_y_n('I confirm that I have read and agree to the Microsoft Azure Preview Terms.') | ||
| if not response: | ||
| raise CLIError('You must agree to the Microsoft Azure Preview Terms to create an account.') | ||
|
||
|
|
||
| # Proceed if user has agreed to the Preview Terms. | ||
| sku = Sku(sku_name) | ||
| lbs_account_create_params = LocationBasedServicesAccountCreateParameters('global', sku, tags) | ||
| lbs_account_create_params = LocationBasedServicesAccountCreateParameters(ACCOUNT_LOCATION, sku, tags) | ||
| return client.create_or_update(resource_group_name, account_name, lbs_account_create_params) | ||
|
|
||
|
|
||
|
|
||
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.
This can be simply reflected from the SDK.