-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
261 additions
and
568 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""Order/create a provisioning script.""" | ||
# :license: MIT, see LICENSE for more details. | ||
|
||
import click | ||
|
||
import SoftLayer | ||
from SoftLayer.CLI import environment | ||
from SoftLayer.CLI import formatting | ||
|
||
|
||
@click.command(cls=SoftLayer.CLI.command.SLCommand) | ||
@click.option('--name', '-N', required=True, prompt=True, help="The name of the hook.") | ||
@click.option('--uri', '-U', required=True, prompt=True, help="The endpoint that the script will be downloaded") | ||
@environment.pass_env | ||
def cli(env, name, uri): | ||
"""Order/create a provisioning script.""" | ||
|
||
manager = SoftLayer.AccountManager(env.client) | ||
|
||
provisioning = manager.create_provisioning(name, uri) | ||
|
||
table = formatting.KeyValueTable(['name', 'value']) | ||
table.align['name'] = 'r' | ||
table.align['value'] = 'l' | ||
|
||
table.add_row(['Id', provisioning.get('id')]) | ||
table.add_row(['Name', provisioning.get('name')]) | ||
table.add_row(['Created', provisioning.get('createDate')]) | ||
table.add_row(['Uri', provisioning.get('uri')]) | ||
|
||
env.fout(table) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Share an image template with another account.""" | ||
# :license: MIT, see LICENSE for more details. | ||
|
||
import click | ||
|
||
import SoftLayer | ||
from SoftLayer.CLI import environment | ||
from SoftLayer.CLI import helpers | ||
|
||
|
||
@click.command(cls=SoftLayer.CLI.command.SLCommand, ) | ||
@click.argument('identifier') | ||
@click.option('--account-id', help='Account Id for another account to share image template', required=True) | ||
@environment.pass_env | ||
def cli(env, identifier, account_id): | ||
"""Share an image template with another account.""" | ||
|
||
image_mgr = SoftLayer.ImageManager(env.client) | ||
image_id = helpers.resolve_id(image_mgr.resolve_ids, identifier, 'image') | ||
shared_image = image_mgr.share_image(image_id, account_id) | ||
|
||
if shared_image: | ||
env.fout("Image template {} was shared to account {}.".format(identifier, account_id)) |
This file contains 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 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 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 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 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 |
---|---|---|
@@ -1 +1,8 @@ | ||
createObject = { | ||
'createDate': '2023-03-22T06:37:45-06:00', | ||
'id': 207054, | ||
'name': 'testslcli', | ||
'uri': 'http://slclitest.com', | ||
'hookType': {} | ||
} | ||
deleteObject = True |
This file contains 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
getAllObjects = [ | ||
{ | ||
"key": "T_1", | ||
"keyName": "TICKET_VIEW", | ||
"name": "View Tickets" | ||
}, | ||
{ | ||
"key": "T_2", | ||
"keyName": "TEST", | ||
"name": "A Testing Permission" | ||
}, | ||
{ | ||
"key": "T_3", | ||
"keyName": "TEST_3", | ||
"name": "A Testing Permission 3" | ||
}, | ||
{ | ||
"key": "T_4", | ||
"keyName": "TEST_4", | ||
"name": "A Testing Permission 4" | ||
}, | ||
{ | ||
"key": "T_5", | ||
"keyName": "ACCESS_ALL_HARDWARE", | ||
"name": "A Testing Permission 5" | ||
}, | ||
{ | ||
'key': 'ALL_1', | ||
'keyName': 'ACCESS_ALL_HARDWARE', | ||
'name': 'All Hardware Access' | ||
}, | ||
{ | ||
'key': 'A_1', | ||
'keyName': 'ACCOUNT_SUMMARY_VIEW', | ||
'name': 'View Account Summary' | ||
}, | ||
{ | ||
'key': 'A_10', | ||
'keyName': 'ADD_SERVICE_STORAGE', | ||
'name': 'Add/Upgrade Storage (StorageLayer)' | ||
} | ||
] |
This file contains 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.