ActivateTopologyActivate a topology.
Syntax
ActivateTopology(reservationId, topologyFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | topologyFullPath | Specify topology (name or full path). For full path, specify the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
Example
cloudshell_api_session.ActivateTopology("af626b88-458b-4e7a-9054-c03d8cffa260", "Topology Folder 1/Topology 1")
AddGroupsToDomainAdd groups to a domain.
Syntax
AddGroupsToDomain(domainName, groupNames=[], readOnly=False)
Parameters
Type | Name | Description |
---|---|---|
string | domainName | Specify the name of the domain. |
list | groupNames | Specify an array of one or more groups. |
boolean | readOnly | Specify if the array of group should be added with view only permissions. |
Example
cloudshell_api_session.AddGroupsToDomain("Global", ["QA_Users", "RND_Users"], False)
AddNewDomainAdds a new domain.
Syntax
AddNewDomain(domainName, description)
Parameters
Type | Name | Description |
---|---|---|
string | domainName | Specify the name of the domain. |
string | description | Specify the description of the domain. |
Example
cloudshell_api_session.AddNewDomain("West Coast Domain", "Domain for west coast users.")
AddNewGroupAdd a new group.
Syntax
AddNewGroup(groupName, description, groupRole)
Parameters
Type | Name | Description |
---|---|---|
string | groupName | Specify the name of the group. |
string | description | Provide a short description of the group. |
string | groupRole | Specify the role of the group, possible values: External, Regular, DomainAdmin. |
Example
cloudshell_api_session.AddNewGroup("QA_Users", "QA users", "Regular")
AddNewUserAdd a new TestShell user.
Syntax
AddNewUser(username, password, email, isActive=False, isAdmin=False)
Parameters
Type | Name | Description |
---|---|---|
string | username | Specify the name of the user. |
string | password | Specify the user’s login password. |
string | Specify the user’s email address. | |
boolean | isActive | Grant or deny active access to the application. |
boolean | isAdmin | Add the user to the System Administrators group. |
Example
cloudshell_api_session.AddNewUser("User1234", "pass1234", "user1234@work.com", True, False)
AddPermittedUsersToReservationAdd permitted users to a reservation.
Syntax
AddPermittedUsersToReservation(reservationId, usernames=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | usernames | List of users to permit access to the reservation. |
Example
cloudshell_api_session.AddPermittedUsersToReservation("2d2f7cde-20g3-4bac-80d2-e8cfhecef45b", ["name1", "name2"])
AddResourcesToDomainAdd resources to a domain.
Syntax
AddResourcesToDomain(domainName, resourcesNames=[], includeDecendants=True)
Parameters
Type | Name | Description |
---|---|---|
string | domainName | Specify the name of the domain. |
list | resourcesNames | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
boolean | includeDecendants | Specify whether to include child resources. |
Example
cloudshell_api_session.AddResourcesToDomain("Domain1", ["Router1234","GenericResource 1234"], True)
AddResourcesToReservationReserve resources for locking.
Syntax
AddResourcesToReservation(reservationId, resourcesFullPath=[], shared=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | resourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
string | shared | Specify whether all resources will be shared among other enviroments |
Example
cloudshell_api_session.AddResourcesToReservation("af626b88-458b-4e7a-9054-c03d8cffa260", ["Router 1234", "GenericResource 1234"], False)
AddRoutesToReservationReserve specified routes.
Syntax
AddRoutesToReservation(reservationId, sourceResourcesFullPath=[], targetResourcesFullPath=[], mappingType, maxHops=0, routeAlias, isShared=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | sourceResourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
list | targetResourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
string | mappingType | Specify bidirectional or unidirectional as the mapping type. |
number | maxHops | Specify the maximum number or allowed hops. |
string | routeAlias | Specify the route’s alias. |
boolean | isShared | Specify whether these routes are shared. Shared routes can be used in more than one reservation. |
Example
cloudshell_api_session.AddRoutesToReservation("28cb2a71-c8fc-4f41-a22b-e65685ebed14", ["Router 1234/Port 1"], ["GenericResource 1234/Port 1"], "bi", 2, "a route", False)
AddTopologiesToDomainAdds a list of one or more topologies to a domain.
Syntax
AddTopologiesToDomain(domainName, topologyNames=[], validateResourceAvailability=True)
Parameters
Type | Name | Description |
---|---|---|
string | domainName | Specify the name of the domain. |
list | topologyNames | Specify a list of topology names. Include the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
boolean | validateResourceAvailability | Validates the existence of the resource resolution in the target domain. Default value: 'True'. Note: when value 'False' is supplied, there is no process of associating resources and routes with the target domain. |
Example
cloudshell_api_session.AddTopologiesToDomain("Domain1", ["Topology1", "Topology2"], True)
AddUsersToGroupAdd users to a group.
Syntax
AddUsersToGroup(usernames=[], groupName)
Parameters
Type | Name | Description |
---|---|---|
list | usernames | Specify an array of one or more users. |
string | groupName | Specify the name of the group. |
Example
cloudshell_api_session.AddUsersToGroup(["User1234", "User2345"], "QA_Users")
AutoLoadOverwrite switch settings with current data.
Syntax
AutoLoad(resourceFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
Example
cloudshell_api_session.AutoLoad("L1 Switch 1234")
AddAttributeRestrictedValuesadd attribute restrictions
Syntax
AddAttributeRestrictedValues(addAttributeRestrictionRequests=[])
Parameters
Type | Name | Description |
---|---|---|
list | addAttributeRestrictionRequests | Attribute restrictions to add.
For example: [AddRestrictionRequest('family_name', 'model_name', sort_values_alphabetically, [Attribute('attribute_name','possible_value')]
|
Example
sort_values_alphabetically = "true"
attribute = cloudshell_api.Attribute("AttrName", "AttrValue")
request = cloudshell_api.AddRestrictionRequest("FamilyName", "ModelName", sort_values_alphabetically, [attribute])
cloudshell_api_session.AddAttributeRestrictedValues([request])
ArchiveDomainArchive the domain
Syntax
ArchiveDomain(domainName)
Parameters
Type | Name | Description |
---|---|---|
string | domainName | Specify the name of the domain. |
Example
cloudshell_api_session.ArchiveDomain("Domain1")
AddAppToReservationAdd an App resource to an existing reservation.
Syntax
AddAppToReservation(reservationId, appName, deploymentPath, positionX=100, positionY=100)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | appName | Specify the App template's name. |
string | deploymentPath | Specify the way the app will be deploy from a given list of options. |
string | positionX | Specify the x coordinate of the App's top left corner. |
string | positionY | Specify the y coordinate of the App's top left corner. |
Example
cloudshell_api_session.AddAppToReservation("077e6b4f-5e70-46b5-aa4b-43e6f039acc3", "Demo App", "vCenter VM From Template", 100, 100)
AddServiceToReservationAdd service resource to existing reservation.
Syntax
AddServiceToReservation(reservationId, serviceName, alias, attributes=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | serviceName | Specify the service name. |
string | alias | Specify the service alias. |
list | attributes | Specify a matrix of attributes and associated attribute values. |
Example
attribute1 = cloudshell_api.AttributeNameValue("string_attribute", "value1")
attribute2 = cloudshell_api.AttributeNameValue("numeric_attribute", "100")
cloudshell_api_session.AddServiceToReservation("077e6b4f-5e70-46b5-aa4b-43e6f039acc3", "Demo Service", "Service Alias", [attribute1, attribute2])
CopyDomainsResourcesCopy resources to a domain.
Syntax
CopyDomainsResources(domainNameSources=[], domainNameDestination)
Parameters
Type | Name | Description |
---|---|---|
list | domainNameSources | Specify the names of the source domains. |
string | domainNameDestination | Specify the name of the target domain. |
Example
cloudshell_api_session.CopyDomainsResources(["Domain1", "Domain2"], "Domain 3")
ClearAndResetConsoleClear and reset consoles.
Syntax
ClearAndResetConsole(reservationId, resourceFullPath, consolePortsFullPath=[], baudRate=0)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
list | consolePortsFullPath | Specify a list of console ports according to their location in the Resource Explorer. Include the full path from the root to each console port, separated by slashes. For example: Console/Ports/PortName. |
string | baudRate | Specify the baud rate to apply to the ports. |
Example
cloudshell_api_session.ClearAndResetConsole("28cb2a71-c8fc-4f41-a22b-e65685ebed14", "GenericResource 1234", ["GenericResource 1234/ConsolePort 21"], 9600)
ConnectRoutesInReservationConnects a list of routes.
Syntax
ConnectRoutesInReservation(reservationId, endpoints=[], mappingType)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | endpoints | The routes’ endpoints to connect. |
string | mappingType | Specify bidirectional or unidirectional as the mapping type. |
Example
cloudshell_api_session.ConnectRoutesInReservation("28cb2a71-c8fc-4f41-a22b-e65685ebed14", ["Router 1234/Port 1","GenericResource 1234/Port 1"], "bi")
CreateFolderAdd a new folder.
Syntax
CreateFolder(folderFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | folderFullPath | Specify the full folder name. Include the full path from the root to a specific folder, separated by slashes. For example: ResourceFamilyFolder/ResourceModelFolder. |
Example
cloudshell_api_session.CreateFolder("Lab Routers")
CreateImmediateReservationCreate an imminent reservation.
Syntax
CreateImmediateReservation(reservationName, owner, durationInMinutes=0, notifyOnStart=False, notifyOnEnd=False, notificationMinutesBeforeEnd=0, isTerminationProtectionEnabled=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationName | Specify the name of the reservation. |
string | owner | Specify the user name of the reservation owner. |
number | durationInMinutes | Specify the length of the reservation. (in minutes) |
boolean | notifyOnStart | Indicate whether to notify the reservation owner when the reservation starts. |
boolean | notifyOnEnd | Indicate whether to notify the reservation owner when the reservation ends. |
number | notificationMinutesBeforeEnd | Indicate the number of minutes before the end of the reservation to send out a Notify On End alert to the reservation owner. (0 = disabled) |
boolean | isTerminationProtectionEnabled | Indicate whether to protect the reservation from being terminated. |
string | approvalSid | Leave empty. Used for internal purposes. |
Example
cloudshell_api_session.CreateImmediateReservation("Immediate Res", "admin", 60, True, False, 0, True)
CreateImmediatePersistentReservationCreate an immediate persistent reservation.
Syntax
CreateImmediatePersistentReservation(reservationName, owner, durationInMinutes=0, notifyOnStart=False, notifyOnEnd=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationName | Specify the name of the reservation. |
string | owner | Specify the user name of the reservation owner. |
boolean | notifyOnStart | Indicate whether to notify the reservation owner when the reservation starts. |
boolean | notifyOnEnd | Indicate whether to notify the reservation owner when the reservation ends. |
list | globalInputs | Global inputs associated with the specified topology. For example: {['Input Name', 'Value';]}. |
list | requirementsInputs | Requirements inputs associated with the specified topology. For example: {['Resource Name', 'Input Name', 'Value', 'AttributeType';]}, AttributeType can be one of the following: Attributes/Models/Quantity. |
list | additionalInfoInputs | Additional info inputs associated with the specified topology. For example: {['Resource Name', 'Input Name', 'Value';]}. |
boolean | notifyOnSetupComplete | Indicate whether to notify the reservation owner when the reservation setup completes. |
Example
cloudshell_api_session.CreateImmediateReservation("Immediate Res", "admin", 60, True, False)
CreateImmediateTopologyReservationCreate an imminent reservation.
Syntax
CreateImmediateTopologyReservation(reservationName, owner, durationInMinutes=0, notifyOnStart=False, notifyOnSetupComplete=False, notifyOnEnd=False, notificationMinutesBeforeEnd=0, topologyFullPath, globalInputs=[], requirementsInputs=[], additionalInfoInputs=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationName | Specify the name of the reservation. |
string | owner | Specify the user name of the reservation owner. |
number | durationInMinutes | Specify the length of the reservation. (in minutes) |
boolean | notifyOnStart | Indicate whether to notify the reservation owner when the reservation starts. |
boolean | notifyOnEnd | Indicate whether to notify the reservation owner when the reservation ends. |
number | notificationMinutesBeforeEnd | Indicate the number of minutes before the end of the reservation to send out a Notify On End alert to the reservation owner. (0 = disabled) |
string | topologyFullPath | Specify topology (name or full path). For full path, specify the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
list | globalInputs | Global inputs associated with the specified topology. For example: [UpdateTopologyGlobalInputsRequest('param-name','value')] |
list | requirementsInputs |
Requirements inputs associated with the specified topology. For example: {['Resource Name', 'Input Name', 'Value', 'AttributeType';]}, AttributeType can be one of the following: Attributes/Models/Quantity.
The Value field can be used to input to requirement fields with different operator types.
If pass value as is, it will be treated as "equals", for example if pass "5" it will indicate to system that seek requirement that fulfills =5
Other operators (aside from equals) can be fulfilled using this convention:
in the value field, write use the format symbol[space]value
for example
for numeric values
> 4
< 4
>= 4
<= 4
= 4
!= 4
for textual values
= "hi there"
!= "hi there"
startswith hi there
endswith hi there
contains hi there
doesnotcontain hi there
|
list | additionalInfoInputs | Additional info inputs associated with the specified topology. |
boolean | notifyOnSetupComplete | Indicate whether to notify the reservation owner when the reservation setup completes. |
Example
# Create Inputs
globalInput = cloudshell_api.UpdateTopologyGlobalInputsRequest("input1", "value1")
requirementsInput = cloudshell_api.UpdateTopologyRequirementsInputsRequest("Resource1", "input2", "value2", "Attributes")
additionalInfoInput = cloudshell_api.UpdateTopologyAdditionalInfoInputsRequest("Resource2", "input3", "value3")
# Create Reservation
cloudshell_api_session.CreateImmediateTopologyReservation("Res1", "admin", 30, True, False, 0, "Temp Automation Resources/TP1", globalInput, requirementsInput, additionalInfoInput)
CreateReservationCreate a reservation.
Syntax
CreateReservation(reservationName, owner, startTime, endTime, notifyOnStart=False, notifyOnEnd=False, notificationMinutesBeforeEnd=0)
Parameters
Type | Name | Description |
---|---|---|
string | reservationName | Specify the name of the reservation. |
string | owner | Specify the user name of the reservation owner. |
string | startTime | The start time of the reservation. |
string | endTime | The end time of the reservation. |
boolean | notifyOnStart | Indicate whether to notify the reservation owner when the reservation starts. |
boolean | notifyOnEnd | Indicate whether to notify the reservation owner when the reservation ends. |
number | notificationMinutesBeforeEnd | Indicate the number of minutes before the end of the reservation to send out a Notify On End alert to the reservation owner. (0 = disabled) |
boolean | isTerminationProtectionEnabled | Indicate whether to protect the reservation from being terminated. |
string | approvalSid | Leave empty. Used for internal purposes. |
Example
cloudshell_api_session.CreateReservation("Res1", "admin", "2015-01-01T10:00:00", "2015-01-01T11:00:00", True, False, 0)
CreatePersistentReservationCreate a reservation.
Syntax
CreatePersistentReservation(reservationName, owner, startTime, notifyOnStart=False, notifyOnEnd=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationName | Specify the name of the reservation. |
string | owner | Specify the user name of the reservation owner. |
string | startTime | The start time of the reservation. |
boolean | notifyOnStart | Indicate whether to notify the reservation owner when the reservation starts. |
boolean | notifyOnEnd | Indicate whether to notify the reservation owner when the reservation ends. |
string | topologyFullPath | Specify topology (name or full path). For full path, specify the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
list | globalInputs | Global inputs associated with the specified topology. For example: {['Input Name', 'Value';]}. |
list | requirementsInputs | Requirements inputs associated with the specified topology. For example: {['Resource Name', 'Input Name', 'Value', 'AttributeType';]}, AttributeType can be one of the following: Attributes/Models/Quantity. |
list | additionalInfoInputs | Additional info inputs associated with the specified topology. For example: {['Resource Name', 'Input Name', 'Value';]}. |
boolean | notifyOnSetupComplete | Indicate whether to notify the reservation owner when the reservation setup completes. |
Example
cloudshell_api_session.CreateReservation("Res1", "admin", "2015-01-01T10:00:00", True, False)
CreateTopologyReservationCreate a reservation.
Syntax
CreateTopologyReservation(reservationName, owner, startTime, endTime, notifyOnStart=False, notifyOnSetupComplete=False, notifyOnEnd=False, notificationMinutesBeforeEnd=0, topologyFullPath, globalInputs=[], requirementsInputs=[], additionalInfoInputs=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationName | Specify the name of the reservation. |
string | owner | Specify the user name of the reservation owner. |
string | startTime | The start time of the reservation. |
string | endTime | The end time of the reservation. |
boolean | notifyOnStart | Indicate whether to notify the reservation owner when the reservation starts. |
boolean | notifyOnEnd | Indicate whether to notify the reservation owner when the reservation ends. |
number | notificationMinutesBeforeEnd | Indicate the number of minutes before the end of the reservation to send out a Notify On End alert to the reservation owner. (0 = disabled) |
string | topologyFullPath | Specify topology (name or full path). For full path, specify the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
list | globalInputs | Global inputs associated with the specified topology. |
list | requirementsInputs |
Requirements inputs associated with the specified topology. For example: {['Resource Name', 'Input Name', 'Value', 'AttributeType';]}, AttributeType can be one of the following: Attributes/Models/Quantity.
The Value field can be used to input to requirement fields with different operator types.
If pass value as is, it will be treated as "equals", for example if pass "5" it will indicate to system that seek requirement that fulfills =5
Other operators (aside from equals) can be fulfilled using this convention:
in the value field, write use the format symbol[space]value
for example
for numeric values
> 4
< 4
>= 4
<= 4
= 4
!= 4
for textual values
= "hi there"
!= "hi there"
startswith hi there
endswith hi there
contains hi there
doesnotcontain hi there
|
list | additionalInfoInputs | Additional info inputs associated with the specified topology. |
boolean | notifyOnSetupComplete | Indicate whether to notify the reservation owner when the reservation setup completes. |
Example
# Create Inputs
globalInput = cloudshell_api.UpdateTopologyGlobalInputsRequest("input1", "value1")
requirementsInput = cloudshell_api.UpdateTopologyRequirementsInputsRequest("Resource1", "input2", "value2", "Attributes")
additionalInfoInput = cloudshell_api.UpdateTopologyAdditionalInfoInputsRequest("Resource2", "input3", "value3")
# Create Reservation
cloudshell_api_session.CreateTopologyReservation("Res1", "admin", "2015-01-01T10:00:00", "2015-01-01T11:00:00", True, False, 0, "Temp Automation Resources/TP1", globalInput, requirementsInput, additionalInfoInput)
CreateResourceAdd a new resource.
Syntax
CreateResource(resourceFamily, resourceModel, resourceName, resourceAddress, folderFullPath, parentResourceFullPath, resourceDescription)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFamily | Specify the name of the resource family (optional). |
string | resourceModel | Specify the resource model. |
string | resourceName | Specify the resource name. |
string | resourceAddress | Specify the resource address. |
string | folderFullPath | Specify the full folder name. Include the full path from the root to a specific folder, separated by slashes. For example: ResourceFamilyFolder/ResourceModelFolder. |
string | parentResourceFullPath | Specify the full path from the root to a parent resource, separated by slashes. For example: Traffic Generators/Generic. |
string | resourceDescription | Provide a short description to help identify the resource. |
Example
#create chassis
cloudshell_api_session.CreateResource("Generic Chassis", "Generic Chassis Model", "Router 1234", "192.168.1.200", "Lab Routers", "", "a generic router")
#create a child port for the chassis
cloudshell_api_session.CreateResource("Generic Port", "Generic Port Model", "Port 1", "1", "Lab Routers", "Router 1234", "a generic router port")
CreateResourcesAdds new resources.
Syntax
CreateResources(resourceInfoDtos=[])
Parameters
Type | Name | Description |
---|---|---|
list | resourceInfoDtos | List of resources to add. |
Example
# Chassis info object
routerDto = cloudshell_api.ResourceInfoDto("Generic Chassis", "Generic Chassis Model", "Router 1234", "192.168.1.200", "Lab Routers", "", "a generic router")
# Port info object
portDto = cloudshell_api.ResourceInfoDto("Generic Port", "Generic Port Model", "Port 1", "1", "Lab Routers", "Router 1234", "a generic router port")
# Create resources
cloudshell_api_session.CreateResources([routerDto, portDto])
CreateRouteInReservationCreate a route between two resources.
Syntax
CreateRouteInReservation(reservationId, sourceResourceFullPath, targetResourceFullPath, overrideActiveRoutes=False, mappingType, maxHops=0, routeAlias, isShared=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | sourceResourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | targetResourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
boolean | overrideActiveRoutes | Specify whether the new route can override existing routes. |
string | mappingType | Specify bidirectional or unidirectional as the mapping type. |
number | maxHops | Specify the maximum number or allowed hops. |
string | routeAlias | Specify the route’s alias. |
boolean | isShared | Specify whether this route is shared. Shared routes can be used in more than one reservation. |
Example
cloudshell_api_session.CreateRouteInReservation("28cb2a71-c8fc-4f41-a22b-e65685ebed14", "Router 1234/Port 1", "GenericResource 1234/Port 1", False, "bi", 2, "a route", False)
CreateRoutesInReservationCreate routes between the listed source and target resources.
Syntax
CreateRouteInReservation(reservationId, sourceResourcesFullPath=[], targetResourcesFullPath=[], overrideActiveRoutes=False, mappingType, maxHops=0, routeAlias, isShared=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | sourceResourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
list | targetResourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
boolean | overrideActiveRoutes | Specify whether the new route can override existing routes. |
string | mappingType | Specify bidirectional or unidirectional as the mapping type. |
number | maxHops | Specify the maximum number or allowed hops. |
string | routeAlias | Specify the route’s alias. |
boolean | isShared | Specify whether these routes are shared. Shared routes can be used in more than one reservation. |
Example
cloudshell_api_session.CreateRoutesInReservation("28cb2a71-c8fc-4f41-a22b-e65685ebed14", ["Router 1234/Port 1"], ["GenericResource 1234/Port 1"], False, "bi", 2, "a route", False)
DeleteDomainDeletes a domain.
Syntax
DeleteDomain(domainName)
Parameters
Type | Name | Description |
---|---|---|
string | domainName | Specify the name of the domain. |
Example
cloudshell_api_session.DeleteDomain("Domain 1")
DeleteTopologyDelete a topology.
Syntax
DeleteTopology(topologyFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | topologyFullPath | Specify topology (name or full path). For full path, specify the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
Example
cloudshell_api_session.DeleteTopology("Temp Automation Resources/TP1")
DeleteFolderDelete a folder.
Syntax
DeleteFolder(folderFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | folderFullPath | Specify the full folder name. Include the full path from the root to a specific folder, separated by slashes. For example: ResourceFamilyFolder/ResourceModelFolder. |
Example
cloudshell_api_session.DeleteFolder("Lab Routers")
DeleteGroupDelete a group.
Syntax
DeleteGroup(groupName)
Parameters
Type | Name | Description |
---|---|---|
string | groupName | Specify the name of the group. |
Example
cloudshell_api_session.DeleteGroup("QA_Users")
DeleteReservationDelete a reservation.
Syntax
DeleteReservation(reservationId, unmap=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
boolean | unmap | Specify whether to keep mappings or release mapped resources when deleting the reservation. |
Example
cloudshell_api_session.DeleteReservation("af626b88-458b-4e7a-9054-c03d8cffa260", True)
DeleteResourceDelete a resource.
Syntax
DeleteResource(resourceFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
Example
cloudshell_api_session.DeleteResource("Router 4321")
DeleteResourcesDeletes the specified resources.
Syntax
DeleteResources(resourcesFullPath=[])
Parameters
Type | Name | Description |
---|---|---|
list | resourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
Example
cloudshell_api_session.DeleteResources(["Router 4321", "Router 5432"])
DeleteUserDeletes a user.
Syntax
DeleteUser(username)
Parameters
Type | Name | Description |
---|---|---|
string | username | Specify the name of the user. |
Example
cloudshell_api_session.DeleteUser("User1234")
DisconnectRoutesInReservationDisconnects a list of routes.
Syntax
DisconnectRoutesInReservation(reservationId, endpoints=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | endpoints | The routes endpoints to disconnect. |
Example
cloudshell_api_session.DisconnectRoutesInReservation("28cb2a71-c8fc-4f41-a22b-e65685ebed14", ["Router 1234/Port 1", "GenericResource 1234/Port 1"])
DecryptPasswordDecrypt a password.
Syntax
DecryptPassword(encryptedString)
Parameters
Type | Name | Description |
---|---|---|
string | encryptedString | The encrypted string for decryption. |
Example
cloudshell_api_session.DecryptPassword("abc")
DeleteResourceTemplateDeletes a specific resource template.
Syntax
DeleteResourceTemplate(resourceTemplateName)
Parameters
Type | Name | Description |
---|---|---|
string | resourceTemplateName | Specify the resource template name. |
Example
cloudshell_api_session.DeleteResourceTemplate("Resource Template 4 tests")
EndReservationEnd a reservation.
Syntax
EndReservation(reservationId, unmap=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
boolean | unmap | Specify whether to keep mappings or release mapped resources when deleting the reservation. |
Example
cloudshell_api_session.EndReservation("af626b88-458b-4e7a-9054-c03d8cffa260", True)
ExcludeResourceExclude a resource.
Syntax
ExcludeResource(resourceFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
Example
cloudshell_api_session.ExcludeResource("L1 Switch 1234")
ExcludeResourcesExcludes the specified resources.
Syntax
ExcludeResources(resourcesFullPath=[])
Parameters
Type | Name | Description |
---|---|---|
list | resourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
Example
cloudshell_api_session.ExcludeResources(["L1 Switch 1234/Blade 1", "L1 Switch 1234/Blade 2"])
SetResourceVisibilitySet the resource visibility state.
Syntax
SetResourceVisibility(resourceFullPath, newVisibility)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | newVisibility | The new visibility state for the resource. options: AdminOnly, Everyone or FamilyDefault |
Example
cloudshell_api_session.SetResourceVisibility("L1 Switch 1234", "AdminOnly")
SetResourceShareLevel
Syntax
SetResourceShareLevel(resourceFullPath, newShareLevel)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the full path of the resource. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | newShareLevel | The new share level of the resource. Options: FamilyDefault, Shared or Unshared. |
Example
cloudshell_api_session.SetResourceShareLevel("L1 Switch 1234", "Shared")
EnqueueResourceCommand
Syntax
EnqueueResourceCommand(reservationId, resourceFullPath, commandName, parameterValues=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | commandName | Specify the name of the command. |
list | parameterValues | Specify the list of parameters values required for executing the command. |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
cloudshell_api_session.EnqueueResourceCommand("af626b88-458b-4e7a-9054-c03d8cffa260", "Router 1234", "ExampleCommand", ["abcd", "2"], True)
EnqueueServiceCommand
Syntax
EnqueueServiceCommand(reservationId, serviceAlias, commandName, parameterValues=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | serviceAlias | Specify the alias of the service. The service alias is its identifier in the environment context. It can be retrieved via the environment details API and is displayed visually on the diagram. |
string | commandName | Specify the name of the command. |
list | parameterValues | Specify the list of parameters values required for executing the command. |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
cloudshell_api_session.EnqueueServiceCommand("af626b88-458b-4e7a-9054-c03d8cffa260", "Service1", "ExampleCommand", ["abcd", "2"], True)
ExecuteResourceCommand
Syntax
ExecuteResourceCommand(reservationId, resourceFullPath, commandName, parameterValues=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | commandName | Specify the name of the command. |
list | parameterValues | Specify the list of parameters values required for executing the command. |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
cloudshell_api_session.ExecuteResourceCommand("af626b88-458b-4e7a-9054-c03d8cffa260", "Router 1234", "ExampleCommand", ["abcd", "2"], True)
ExecuteResourceConnectedCommand
Syntax
ExecuteResourceConnectedCommand(reservationId, resourceFullPath, commandName, commandTag, parameterValues=[], connectedPortsFullPath=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: RouterA/Port1. |
string | commandName | Specify the name of the command. |
string | commandTag | Specify the command tag. Connected command tags are used to define categories of functionality (e.g 'virtualization'). |
list | parameterValues | Specify the list of parameters values required for executing the command. |
list | connectedPortsFullPath | Specify the list of connected ports to use in this operation. Include the full path from the root resource to each port, separated by slashes. For example: Switch20/Blade5/PowerPort1. Leave blank to perform the connected operation on all of the specified resource’s connected ports. |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
ExecuteResourceConnectedCommand("af626b88-458b-4e7a-9054-c03d8cffa260", "Router 1234", "SpinUp","virtualization", ["abcd", "2"], ["Router 1234/Port1"], True)
EnqueueTopologyCommandEnqueue a topology command.
Syntax
EnqueueTopologyCommand(reservationId, commandName, parameterValues=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | commandName | Specify the name of the command. |
list | parameterValues | Specify the list of parameters values required for executing the command. |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
cloudshell_api_session.EnqueueTopologyCommand("af626b88-458b-4e7a-9054-c03d8cffa260", "ExampleCommand", ["abcd", "2"], True)
ExecuteTopologyCommandExecute a topology command.
Syntax
ExecuteTopologyCommand(reservationId, commandName, parameterValues=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | commandName | Specify the name of the command. |
list | parameterValues | Specify the list of parameters values required for executing the command. |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
cloudshell_api_session.ExecuteTopologyCommand("af626b88-458b-4e7a-9054-c03d8cffa260", "ExampleCommand", ["abcd", "2"], True)
ExtendReservationExtend a reservation.
Syntax
ExtendReservation(reservationId, minutesToAdd=0)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
number | minutesToAdd | Specify the number of minutes to add to the specified reservation. |
Example
cloudshell_api_session.ExtendReservation("af626b88-458b-4e7a-9054-c03d8cffa260", 60)
UpdateReservationEndTimeUpdate a reservation end time or persistence.
Syntax
UpdateReservationEndTime(reservationId, isPersistent, endTime)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
boolean | isPersistent | Enable or disable Reservation Persistence. |
string | endTime | The end time of the reservation. |
Example
cloudshell_api_session.UpdateReservationEndTime("af626b88-458b-4e7a-9054-c03d8cffa260", true, "")
ExportFamiliesAndModelsExports the resource families, models, attributes and structure configuration.
Syntax
ExportFamiliesAndModels()
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.ExportFamiliesAndModels()
ExecuteServiceCommand
Syntax
ExecuteServiceCommand(reservationId, serviceAlias, commandName, parameterValues=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | serviceAlias | Specify the alias of the service. |
string | commandName | Specify the name of the command. |
list | parameterValues | Specify the list of parameters values required for executing the command. |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
cloudshell_api_session.ExecuteServiceCommand("af626b88-458b-4e7a-9054-c03d8cffa260", "Service 1", "ExampleCommand", ["abcd", "2"], True)
DeployAppToCloudProviderDeploy app to cloud provider
Syntax
DeployAppToCloudProvider(reservationId, appName, commandInputs=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | appName | Specify the name of the app. |
list | commandInputs | Specify a list of input names and values required for executing the command. Note that to change a deployed App's name, specify the new name as an input value - for example: api.DeployAppToCloudProvider(reservation_id, "Azure Ubuntu", [InputNameValue("Name", "myvm01")]). |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
val1 = cloudshell_api.InputNameValue("input1", "value1")
val2 = cloudshell_api.InputNameValue("input2", "value2")
cloudshell_api_session.DeployAppToCloudProvider("af626b88-458b-4e7a-9054-c03d8cffa260", "app name", [val1, val2], True)
DeployAppToCloudProviderBulk
Syntax
DeployAppToCloudProviderBulk(reservationId, appNames=[], commandInputs=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | appNames | Specify the names of the apps to deploy. |
list | commandInputs | Specify a list of input names and values required for executing the command [appName, InputName, InputValue]. Note that to change a deployed App's name, specify the new name as an input value - for example: api.DeployAppToCloudProvider(reservation_id, "Azure Ubuntu", [DeployAppInput("Azure Ubuntu", "Name", "myvm01")]). |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
deployAppInput1 = cloudshell_api.DeployAppInput("app1", "inputName1", "inputValue1")
deployAppInput2 = cloudshell_api.DeployAppInput("app2", "inputName2", "inputValue2")
cloudshell_api_session.DeployAppToCloudProviderBulk("af626b88-458b-4e7a-9054-c03d8cffa260", ["app1", "app2"], [deployAppInput1, deployAppInput2])
RefreshAppInBlueprintsRefresh Apps in multiple blueprints from the App template
Syntax
RefreshAppInBlueprints(appTemplateName, topologyNames=[])
Parameters
Type | Name | Description |
---|---|---|
string | appTemplateName | Specify the name of the App template to be used to refresh the App instances. |
list | topologyNames | Specify an optional list of blueprint names. Include the full path from the root to the blueprint, separated by slashes. For example: FolderName/Topologies/TopologyName. If the list is not specified, Apps in all blueprints will be refreshed. |
Example
cloudshell_api_session.RefreshAppInBlueprints("testApp", ["Topology1"])
RefreshVMDetails
Syntax
RefreshVMDetails(reservationId, deployedAppNames=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | deployedAppNames | Names of deployed apps whose vm details will be refreshed. |
Example
cloudshell_api_session.RefreshVMDetails("af626b88-458b-4e7a-9054-c03d8cffa260", ["app1", "app2"])
EditAppsInReservation
Syntax
EditAppsInReservation(reservationId, editAppsRequests=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | editAppsRequests | Changes to implement in the App. Please note that when modifying attributes, *all* the attributes in deployed app must be updated. |
Example
appAttribute = cloudshell_api.NameValuePair("name", "value")
appDetails = cloudshell_api.AppDetails("modelName", [appAttribute], "driverName")
deploymentAttribute = cloudshell_api.NameValuePair("name", "value")
deployment = cloudshell_api.Deployment([deploymentAttribute])
defaultDeployment = cloudshell_api.DefaultDeployment("default deployment", deployment)
editRequest = cloudshell_api.ApiEditAppRequest("app1", "app1NewName", "description", appDetails, defaultDeployment)
cloudshell_api_session.EditAppsInReservation("af626b88-458b-4e7a-9054-c03d8cffa260", [editRequest])
PrepareSandboxConnectivity
Syntax
PrepareSandboxConnectivity(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
Example
cloudshell_api_session.PrepareSandboxConnectivity("af626b88-458b-4e7a-9054-c03d8cffa260")
CleanupSandboxConnectivity
Syntax
CleanupSandboxConnectivity(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
Example
cloudshell_api_session.CleanupSandboxConnectivity("af626b88-458b-4e7a-9054-c03d8cffa260")
ConfigureApps
Syntax
ConfigureApps(reservationId, appConfigurations=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | appConfigurations | Configuration details. Note: Running ConfigureApps with parameters that are missing from the App returns a success message. |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
configParam = cloudshell_api.ConfigParam("configName", "configValue")
appConfig = cloudshell_api.AppConfiguration("AppName", [configParam])
cloudshell_api_session.ConfigureApps("af626b88-458b-4e7a-9054-c03d8cffa260", [appConfig], True)
ConfigureAppsV2
Syntax
ConfigureAppsV2(reservationId, appConfigurations=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | appConfigurationsData | Configuration details. Note: Running ConfigureAppsV2 with parameters that are missing from the App returns a success message. |
boolean | printOutput | Defines whether to print the command output in the sandbox command output window. |
Example
configParam = cloudshell_api.ConfigParam("configName", "configValue")
configManagementParam = cloudshell_api.ConfigurationManagementData("alias", [configParam])
appConfig = cloudshell_api.AppConfigurationData("AppName", [configManagementParam])
cloudshell_api_session.ConfigureAppsV2("af626b88-458b-4e7a-9054-c03d8cffa260", [appConfig], True)
CheckoutFromPoolCheckout from pool
Syntax
CheckoutFromPool(selectionCriteriaJson)
Parameters
Type | Name | Description |
---|---|---|
string | selectionCriteriaJson | Json string that represents a selection request for an item or multiple items from a pool. |
Example
cloudshell_api_session.CheckoutFromPool("{'selection': 'criteria'}")
GetModelUsageReportGet model usages
Syntax
GetModelUsageReport(modelName)
Parameters
Type | Name | Description |
---|---|---|
string | modelName | Specify the name of the model to retrieve usages for. |
Example
cloudshell_api_session.GetModelUsageReport("modelName")
SetCustomShellAttributeAdd a custom attribute to an existing shell
Syntax
SetCustomShellAttribute(modelName, attributeName, defaultValue, restrictedValues=[])
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.SetCustomShellAttribute("modelName", "attributeName", "yes", ["yes", "no"])
RemoveCustomShellAttributeRemove a custom attribute from an existing shell
Syntax
RemoveCustomShellAttribute(modelName, attributeName)
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.RemoveCustomShellAttribute("modelName", "attributeName")
ReleaseFromPoolRelease from pool
Syntax
ReleaseFromPool(values=[], poolId, reservationId, ownerId)
Parameters
Type | Name | Description |
---|---|---|
list | values | Values to release from the pool. |
string | poolId | The specific pool where to search for the values that you want to release. |
string | reservationId | Reservation id that is assoicated with the pool values. It can also be an empty string if the values are not associated with a reservation. |
string | ownerId | The owner of the pool values. |
Example
cloudshell_api_session.ReleaseFromPool(["value1", "value2"], "poolId", "af626b88-458b-4e7a-9054-c03d8cffa260", "admin")
EnqueueEnvironmentCommandEnqueue an environment command.
Syntax
EnqueueEnvironmentCommand(reservationId, commandName, commandInputs=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | commandName | Specify the name of the command. |
list | commandInputs | Specify a matrix of input names and values required for executing the command. |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
cmdInput = cloudshell_api.InputNameValue("inputName", "inputValue")
cloudshell_api_session.EnqueueEnvironmentCommand("af626b88-458b-4e7a-9054-c03d8cffa260", "commandName", [cmdInput], True)
ExecuteEnvironmentCommandExecute an environment command.
Syntax
ExecuteEnvironmentCommand(reservationId, commandName, commandInputs=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | commandName | Specify the name of the command. |
list | commandInputs | Specify a matrix of input names and values required for executing the command. |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
cmdInput = cloudshell_api.InputNameValue("inputName", "inputValue")
cloudshell_api_session.ExecuteEnvironmentCommand("af626b88-458b-4e7a-9054-c03d8cffa260", "commandName", [cmdInput], True)
EnqueueCommandEnqueue a command.
Syntax
EnqueueCommand(reservationId, targetName, targetType, commandName, commandInputs=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | targetName | Specify the name of the target according to the target type: for resources - specify the resouce's name, for services - the service's alias. |
string | targetType | Specify the target type for command execution, possible values are: Resource, Service, App. |
string | commandName | Specify the name of the command. |
list | commandInputs | Specify a matrix of input names and values required for executing the command. |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
cmdInput = cloudshell_api.InputNameValue("inputName", "inputValue")
cloudshell_api_session.EnqueueCommand("af626b88-458b-4e7a-9054-c03d8cffa260", "Router1234", "Resource", "commandName", [cmdInput], True)
ExecuteCommandExecute a command.
Syntax
ExecuteCommand(reservationId, targetName, targetType, commandName, commandInputs=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | targetName | Specify the name of the target according to the target type: for resources - specify the resouce's name, for services - the service's alias. |
string | targetType | Specify the target type for command execution, possible values are: Resource, Service, App. |
string | commandName | Specify the name of the command. |
list | commandInputs | Specify a matrix of input names and values required for executing the command. |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
cmdInput = cloudshell_api.InputNameValue("inputName", "inputValue")
cloudshell_api_session.ExecuteCommand("af626b88-458b-4e7a-9054-c03d8cffa260", "Router1234", "Resource", "commandName", [cmdInput], True)
FindResources
Syntax
FindResources(resourceFamily, resourceModel, attributeValues=[], showAllDomains=False, resourceFullName, exactName=True, includeSubResources=True, resourceAddress, resourceUniqueIdentifier, maxResults=500, includeExcludedResources=False)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFamily | Specify the name of the resource family. |
string | resourceModel | Specify the resource model. |
list | attributeValues | Specify an array of one or more attributes and attribute values. |
boolean | showAllDomains | Show all domains associated with the logged in user. |
string | resourceFullName | Specify part of or the full name of the resource. |
boolean | exactName | Specify whether to search the exact given name or not. |
boolean | includeSubResources | Specify whether to retrieve the sub resources once the parent matches the name. |
string | resourceAddress | Specify the resource address. Can be partial (e.g. '192.168.'). |
string | resourceUniqueIdentifier | Specify the resource unique identifier. |
number | maxResults | Specify the maximum number of resources to return. |
boolean | includeExcludedResources | Specify whether to retrieve resources that are excluded |
Example
attrValue = cloudshell_api.AttributeNameValue("attrName", "attrValue")
cloudshell_api_session.FindResources("familyName", "modelName", [attrValue], True, "Router 1234", True, True, "192.168.41.67", "resourceId", 100, False)
FindResourcesInTimeRange
Syntax
FindResourcesInTimeRange(resourceFamily, resourceModel, fromTime, untilTime, attributeValues=[], showAllDomains=False, resourceFullName, exactName=True, includeSubResources=True, resourceAddress, resourceUniqueIdentifier, maxResults=500)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFamily | Specify the name of the resource family. |
string | resourceModel | Specify the resource model. |
string | fromTime | Specify from which future time and date to check the resource's availability. |
string | untilTime | Specify until which time and date to check the resource's availability. |
list | attributeValues | Specify an array of one or more attributes and attribute values. |
boolean | showAllDomains | Show all domains associated with the logged in user. |
string | resourceFullName | Specify part of or the full name of the resource. |
boolean | exactName | Specify whether to search the exact given name or not. |
boolean | includeSubResources | Specify whether to retrieve the sub resources once the parent matches the name. |
string | resourceAddress | Specify the resource address. Can be partial (e.g. '192.168.'). |
string | resourceUniqueIdentifier | Specify the resource unique identifier. |
number | maxResults | Specify the maximum number of resources to return. |
Example
attrValue = cloudshell_api.AttributeNameValue("attrName", "attrValue")
cloudshell_api_session.FindResourcesInTimeRange("familyName", "modelName", "03/01/2012 00:00", "05/31/2012 23:59", [attrValue], True, "Router 1234", True, True, "192.168.41.67", "resourceId", 100, False)
GetReservationResourcesPositionsGet resource positions in a reservation.
Syntax
GetReservationResourcesPositions(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
Example
cloudshell_api_session.GetReservationResourcesPositions("af626b88-458b-4e7a-9054-c03d8cffa260")
GetRoutesSolutionGet solution for specified routes.
Syntax
GetRoutesSolution(reservationId, sourceResourcesFullPath=[], targetResourcesFullPath=[], mappingType, maxHops=0, isShared=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | sourceResourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: RootResourceName/ResourceName |
list | targetResourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: RootResourceName/ResourceName |
string | mappingType | Specify bidirectional or unidirectional as the mapping type. |
number | maxHops | Specify the maximum number or allowed hops. |
boolean | isShared | Specify whether these routes are shared. Shared routes can be used in more than one reservation. |
Example
cloudshell_api_session.GetRoutesSolution("af626b88-458b-4e7a-9054-c03d8cffa260", ["Router 1234/Port 1"], ["GenericResource 1234/Port 1"], "bi", 2, False)
GenerateUtilizationReportGenerate a utilization report.
Syntax
GenerateUtilizationReport(resourceFamilyName, fromDate, toDate, resourceFullName, resourceModelName, includeChildResources=False, groupBy, utilizationReportType)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFamilyName | Specify the name of the resource family. |
string | fromDate | Specify the start time and date. |
string | toDate | Specify the end time and date. |
string | resourceFullName | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName. |
string | resourceModelName | Specify the resource model. |
boolean | includeChildResources | Specify whether to include child resources utilization. |
string | groupBy | Specify how to group the utilization results: Resource, User, or Machine |
string | utilizationReportType | Specify the report type: Lock or Mapping. |
Example
cloudshell_api_session.GenerateUtilizationReport("familyName", "03/01/2012 00:00", "05/31/2012 23:59", "Router 1234", "modelName", False, "Resource", "Lock")
GetActiveTopologyNamesRetrieve a user's reserved topologies.
Syntax
GetActiveTopologyNames()
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.GetActiveTopologyNames()
GetAllUsersDetailsRetrieve all users and user settings.
Syntax
GetAllUserDetails()
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.GetAllUsersDetails()
GetAttributeValueRetrieve an attribute's value.
Syntax
GetAttributeValue(resourceFullPath, attributeName)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | attributeName | Specify the attribute name. |
Example
cloudshell_api_session.GetAttributeValue("Router 1234", "attributeName")
GetCategoriesOfTopologyRetrieves all categories of a given topology.
Syntax
GetCategoriesOfTopology(topologyPath)
Parameters
Type | Name | Description |
---|---|---|
string | topologyPath | Specify topology (name or full path). For full path, specify the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
Example
cloudshell_api_session.GetCategoriesOfTopology("Folder1/exampleTopology")
GetCurrentReservationsRetrieve current reservations.
Syntax
GetCurrentReservations(reservationOwner)
Parameters
Type | Name | Description |
---|---|---|
string | reservationOwner | Specify the user name of the reservation owner. |
Example
cloudshell_api_session.GetCurrentReservations("admin")
GetDomainDetailsRetrieves a domain's details including groups, topologies and resources associated with the specified domain.
Syntax
GetDomainDetails(domainName)
Parameters
Type | Name | Description |
---|---|---|
string | domainName | Specify the name of the domain. |
Example
cloudshell_api_session.GetDomainDetails("US Domain")
GetFolderContentRetrieve content for a specified path.
Syntax
GetFolderContent(fullPath, showAllDomains=False)
Parameters
Type | Name | Description |
---|---|---|
string | fullPath | Specify the full folder name. Include the full path from the root to a specific folder, separated by slashes. For example: ResourceFamilyFolder/ResourceModelFolder. |
boolean | showAllDomains | Show all domains associated with the logged in user. |
Example
cloudshell_api_session.GetFolderContent("ResourceFamilyFolder/ResourceModelFolder", True)
MoveFolderAllows to change the location of a folder (and all its content, including sub folders) in the folder hierarchy.
Syntax
MoveFolder(originalFolder, targetFolder)
Parameters
Type | Name | Description |
---|---|---|
string | originalFolder | Path of the folder to be moved. |
string | targetFolder | The path of the new containing folder. To move a folder to root, value should be empty. |
Example
cloudshell_api_session.MoveFolder("root/oldFolder", "root/newFolder")
GetGroupDomainsRetrieve a group's domains.
Syntax
GetGroupDomains(groupName)
Parameters
Type | Name | Description |
---|---|---|
string | groupName | Specify the name of the group. |
Example
cloudshell_api_session.GetGroupDomains("SC Group")
GetGroupsDetailsRetrieve all system groups.
Syntax
GetGroupsDetails()
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.GetGroupsDetails()
GetLockedResourcesRetrieve a list of locked resources.
Syntax
GetLockedResources(user, machine, folderFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | user | Specify a user name to retrieve locked resources for that user. |
string | machine | Specify a machine name to retrieve locked resources for that computer. |
string | folderFullPath | Specify the full folder name. Include the full path from the root to a specific folder, separated by slashes. For example: ResourceFamilyFolder/ResourceModelFolder. |
Example
cloudshell_api_session.GetLockedResources("admin", "", "")
GetReservationDetailsRetrieve reservation details and parameters.
Syntax
GetReservationDetails(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
boolean | disableCache | Specify if the reservation detail is new or cached |
Example
cloudshell_api_session.GetReservationDetails("af626b88-458b-4e7a-9054-c03d8cffa260")
GetReservationAppImageRetrieve the photo of an app template.
Syntax
GetReservationAppImage(reservationId, appName)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | appName | Specify the name of the app. |
Example
cloudshell_api_session.GetReservationAppImage("af626b88-458b-4e7a-9054-c03d8cffa260", "mySite")
GetReservationStatusRetrieve reservation status
Syntax
GetReservationStatus(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | startTime | The start time and date for the specified reservation. |
string | endTime | The end time and date for the specified reservation. |
string | reservationStatus | Indicates the current reservation status. |
string | provisioningStatus | Indicates the current provisioning status. |
boolean | fullyBooked | Indicates if the current reservation is fully booked. |
Example
cloudshell_api_session.GetReservationStatus("af626b88-458b-4e7a-9054-c03d8cffa260")
GetResourcesLabelsInReservationGet resources associated with labels in reservation.
Syntax
GetResourcesLabelsInReservation(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
Example
cloudshell_api_session.GetResourcesLabelsInReservation("af626b88-458b-4e7a-9054-c03d8cffa260")
GetReservationInputsRetrieves all topology inputs for a specified reservation.
Syntax
GetReservationInputs(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | globalInputs | Global inputs associated with the specified reservation. |
list | requirementsInputs | Requirements inputs associated with the specified reservation. |
list | additionalInfoInputs | Additional info inputs associated with the specified reservation. |
Example
cloudshell_api_session.GetReservationInputs("af626b88-458b-4e7a-9054-c03d8cffa260")
GetReservationRemainingTimeRetrieve the amount of time until the end of a reservation.
Syntax
GetReservationRemainingTime(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
Example
cloudshell_api_session.GetReservationRemainingTime("af626b88-458b-4e7a-9054-c03d8cffa260")
GetResourceAvailabilityGet resource availability.
Syntax
GetResourceAvailability(resourcesNames=[], showAllDomains=False)
Parameters
Type | Name | Description |
---|---|---|
list | resourcesNames | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
boolean | showAllDomains | Show all domains associated with the logged in user. |
Example
cloudshell_api_session.GetResourceAvailability(["Router 1234", "GenericResource 1234"], False)
GetResourceAvailabilityInTimeRangeGet resource availability during a specific time range.
Syntax
GetResourceAvailabilityInTimeRange(resourcesNames=[], startTime, endTime, showAllDomains=False)
Parameters
Type | Name | Description |
---|---|---|
list | resourcesNames | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
string | startTime | The start time of the reservation. |
string | endTime | The end time of the reservation. |
boolean | showAllDomains | Show all domains associated with the logged in user. |
Example
cloudshell_api_session.GetResourceAvailabilityInTimeRange(["Router 1234", "GenericResource 1234"], "03/01/2012 00:00", "05/31/2012 23:59", False)
GetResourceCommandsRetrieve resource driver commands.
Syntax
GetResourceCommands(resourceFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
Example
cloudshell_api_session.GetResourceCommands("Router 1234")
GetServiceCommandsRetrieve service driver commands.
Syntax
GetServiceCommands(serviceName)
Parameters
Type | Name | Description |
---|---|---|
string | serviceName | Specify the service name. |
Example
cloudshell_api_session.GetServiceCommands("VLAN")
GetResourceConnectedCommandsRetrieve resource driver commands.
Syntax
GetResourceConnectedCommands(resourceFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
Example
cloudshell_api_session.GetResourceConnectedCommands("Router 1234")
GetResourceDetailsRetrieve the resource parameters and attributes.
Syntax
GetResourceDetails(resourceFullPath, showAllDomains=False)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
boolean | showAllDomains | Show all domains associated with the logged in user. |
Example
cloudshell_api_session.GetResourceDetails("Lab Routers/Router 1234", False)
GetResourceListRetrieve a list of resources for a specified path.
Syntax
GetResourceList(folderFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | folderFullPath | Specify the full folder name. Include the full path from the root to a specific folder, separated by slashes. For example: ResourceFamilyFolder/ResourceModelFolder. |
Example
cloudshell_api_session.GetResourceList("Lab Routers")
GetResourceLiveStatusGets the live status of a resource.
Syntax
GetResourceLiveStatus(resourceFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA. |
Example
cloudshell_api_session.GetResourceLiveStatus("Router 1234")
GetReservationsLiveStatusGets the live status the reservations.
Syntax
GetReservationsLiveStatus(reservationsIds=[])
Parameters
Type | Name | Description |
---|---|---|
list | reservationsId | Specifies a string array that represents reservation unique identifiers. |
Example
cloudshell_api_session.GetReservationsLiveStatus(["a2f1b35e-3deb-42ee-b70d-78189dd10d56"])
GetResourceMappingsRetrieve current mappings for specified resources.
Syntax
GetResourceMappings(resources=[])
Parameters
Type | Name | Description |
---|---|---|
list | resources | Specify a list of resources. |
Example
cloudshell_api_session.GetResourceMappings(["L1 Switch 1234/Blade 1/Port 2"]
GetRouteSegmentsRetrieves all the ports on the route.
Syntax
GetRouteSegments(resource)
Parameters
Type | Name | Description |
---|---|---|
string | resource | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
Example
cloudshell_api_session.GetRouteSegments("Router 1234/Port 1")
GetScheduledReservationsRetrieve scheduled reservations for a specified time range.
Syntax
GetScheduledReservations(fromTime, untilTime, ownerName)
Parameters
Type | Name | Description |
---|---|---|
string | fromTime | Specify from which time and date to search. |
string | untilTime | Specify until which time and date to search. |
string | ownerName | Specify reservation owner name |
Example
cloudshell_api_session.GetScheduledReservations("01/01/2015 08:00", "01/01/2015 12:00")
CreateDraftCreate a private draft of a blueprint.
Syntax
CreateDraft(topology, newName)
Parameters
Type | Name | Description |
---|---|---|
string | topology | Specify the topology id, or name or the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
string | draftName | Optionally specify the name of the draft. Leave empty for an automatically generated name based on original |
Example
cloudshell_api_session.CreateDraft("Topologies/Topology1", "New Name")
PromoteDraftOverrwrite the original blueprint with the draft, and delete the draft.
Syntax
PromoteDraft(topologyFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | draft | Specify the draft id, or name or the full path from the root to the draft, separated by slashes. For example: FolderName/Topologies/DraftName. |
Example
cloudshell_api_session.PromoteDraft("Topologies/Topology1")
DeleteDraftDelete a draft.
Syntax
DeleteDraft(topology)
Parameters
Type | Name | Description |
---|---|---|
string | draft | Specify the draft id, or name or the full path from the root to the draft, separated by slashes. For example: FolderName/Topologies/DraftName. |
Example
cloudshell_api_session.DeleteDraft("Topologies/draft1")
GetServerDateAndTimeRetrieve the server's date and time.
Syntax
GetServerDateAndTime()
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.GetServerDateAndTime()
GetTopologyCommandsRetrieve available topology commands in a reservation.
Syntax
GetTopologyCommands(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
Example
cloudshell_api_session.GetTopologyCommands("af626b88-458b-4e7a-9054-c03d8cffa260")
GetEnvironmentCommandsRetrieve available environment commands in a reservation.
Syntax
GetEnvironmentCommands(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
Example
cloudshell_api_session.GetEnvironmentCommands("af626b88-458b-4e7a-9054-c03d8cffa260")
GetTopologyUrlsRetrieve Topology Urls.
Parameters
Type | Name | Description |
---|---|---|
string | topologyFullPath | Specify topology (name or full path). For full path, specify the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
GetTopologyDetailsRetrieve the topology parameters and attributes.
Syntax
GetTopologyDetails(topologyFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | topologyFullPath | Specify topology (name or full path). For full path, specify the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
Example
cloudshell_api_session.GetTopologyDetails("Temp Automation Resources/TP1")
GetResourcesLabelsInTopologyGet resources associated with labels in topology.
Syntax
GetResourcesLabelsInTopology(topologyName)
Parameters
Type | Name | Description |
---|---|---|
string | topologyName | Specify the topology name. |
Example
cloudshell_api_session.GetResourcesLabelsInTopology("topo1")
GetTopologiesByCategoryRetrieves the full path of all topologies.
Syntax
GetTopologiesByCategory(categoryName, categoryValue)
Parameters
Type | Name | Description |
---|---|---|
string | categoryName | Specify the category's name, If category name is not provided will return all topologies in domain. |
string | categoryValue | Specify the category's value/sub category |
Example
cloudshell_api_session.GetTopologiesByCategory("lookupCategory", "bonjour")
GetTopologyCategoriesRetrieves all topology categories.
Syntax
GetTopologyCategories()
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.GetTopologyCategories()
GetCategoriesRetrieves all the logged in user's root categories and sub categories
Syntax
GetCategories(type)
Parameters
Type | Name | Description |
---|---|---|
string | type | Specify the categoriy type: Services, Environment or empty for both. |
Example
cloudshell_api_session.GetCategories("")
GetUserDetailsRetrieve a user's settings.
Syntax
GetUserDetails(username)
Parameters
Type | Name | Description |
---|---|---|
string | username | Specify the name of the user. |
Example
cloudshell_api_session.GetUserDetails("User1234")
GetAbstractTemplateListRetrieve a list of abstract templates.
Syntax
GetAbstractTemplateList()
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.GetAbstractTemplateList()
GetServicesRetrieve a list of services and their attributes.
Syntax
GetServices(categoryName, serviceName)
Parameters
Type | Name | Description |
---|---|---|
string | categoryName | The name of the category of the services you want to receive. |
string | serviceName | The name of the service you want to receive. |
Example
cloudshell_api_session.GetServices("CategoryName", "ServiceName")
GetReservationServicesPositionsGet service positions in a reservation.
Syntax
GetReservationServicesPositions(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
Example
cloudshell_api_session.GetReservationServicesPositions("af626b88-458b-4e7a-9054-c03d8cffa260")
IncludeResourceInclude a resource.
Syntax
IncludeResource(resourceFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
Example
cloudshell_api_session.IncludeResource("Router 1234")
IncludeResourcesIncludes the specified resources.
Syntax
IncludeResources(resourcesFullPath=[])
Parameters
Type | Name | Description |
---|---|---|
list | resourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
Example
cloudshell_api_session.IncludeResources(["Router 1234", "L1 Switch 1234"])
LockResourceLock a resource.
Syntax
LockResource(reservationId, resourceFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
Example
cloudshell_api_session.LockResource("af626b88-458b-4e7a-9054-c03d8cffa260", "GenericResource 1234/Port 1")
LockResourcesLock multiple resources.
Syntax
LockResources(reservationId, resourcesFullPath=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | resourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
Example
cloudshell_api_session.LockResources("af626b88-458b-4e7a-9054-c03d8cffa260", ["GenericResource 1234/Port 1", "Router 1234"])
LogoffLogoff from resource manager service.
Syntax
Logoff()
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.Logoff()
LogonLog in to the TestShell service.
Syntax
Logon(username, password, domainName='Global')
Parameters
Type | Name | Description |
---|---|---|
string | username | Username to logon with. |
string | password | Specify the user’s login password. |
string | domainName | Specify the name of the domain. If no domain is specified, it logs the user in to the global (default) domain. |
Example
cloudshell_api_session.Logon("admin", "admin", "Global")
LogoutTNSessionLogout from a console port TN session.
Syntax
LogoutTNSession(reservationId, resourceFullPath, consolePortsFullPath=[], baudRate=0)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
list | consolePortsFullPath | Specify a list of console ports according to their location in the Resource Explorer. Include the full path from the root to each console port, separated by slashes. For example: Console/Ports/PortName. |
string | baudRate | Specify the baud rate to apply to the ports. |
Example
cloudshell_api_session.LogoutTNSession("af626b88-458b-4e7a-9054-c03d8cffa260", "GenericResource 1234", ["GenericResource 1234/ConsolePort 21"], 9600)
MapPortsMap ports on a L1 switch.
Syntax
MapPorts(sourcePort, destinationPort, mappingType)
Parameters
Type | Name | Description |
---|---|---|
string | sourcePort | Specify the source port. |
string | destinationPort | Specify the destination port. |
string | mappingType | Specify bidirectional or unidirectional as the mapping type. |
Example
cloudshell_api_session.MapPorts("L1 Switch 1234/Blade 1/Port 1", "L1 Switch 1234/Blade 1/Port 3", "bi")
PowerCycleResourceCycle power for resource power ports.
Syntax
PowerCycleResource(reservationId, resourceFullPath, powerPortsFullPath=[], delay=0)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the reservation’s unique identifier. Admin users may leave this parameter blank to perform power operations on excluded resources. |
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
list | powerPortsFullPath | Specify the list of power ports to use in this operation. Include the full path from the root resource to each power port, separated by slashes. For example: Switch20/Blade5/PowerPort1. Leave blank to perform the power operation on all of the specified resource’s power ports. |
string | delay | Specify the number of seconds to delay between each power cycle. |
Example
cloudshell_api_session.PowerCycleResource("af626b88-458b-4e7a-9054-c03d8cffa260", "GenericResource 1234", ["GenericResource 1234/PowerPort 11"], 2)
PowerOffResourcePower off resource power ports.
Syntax
PowerOffResource(reservationId, resourceFullPath, powerPortsFullPath=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the reservation’s unique identifier. Admin users may leave this parameter blank to perform power operations on excluded resources. |
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
list | powerPortsFullPath | Specify the list of power ports to use in this operation. Include the full path from the root resource to each power port, separated by slashes. For example: Switch20/Blade5/PowerPort1. Leave blank to perform the power operation on all of the specified resource’s power ports. |
Example
cloudshell_api_session.PowerOffResource("af626b88-458b-4e7a-9054-c03d8cffa260", "GenericResource 1234", ["GenericResource 1234/PowerPort 11"])
PowerOnResourcePower on resource power ports.
Syntax
PowerOnResource(reservationId, resourceFullPath, powerPortsFullPath=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the reservation’s unique identifier. Admin users may leave this parameter blank to perform power operations on excluded resources. |
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
list | powerPortsFullPath | Specify the list of power ports to use in this operation. Include the full path from the root resource to each power port, separated by slashes. For example: Switch20/Blade5/PowerPort1. Leave blank to perform the power operation on all of the specified resource’s power ports. |
Example
cloudshell_api_session.PowerOnResource("af626b88-458b-4e7a-9054-c03d8cffa260", "GenericResource 1234", ["GenericResource 1234/PowerPort 11"])
RemoveAttributeRestrictedValuesremove attribute restrictions
Syntax
RemoveAttributeRestrictedValues(removeAttributeRestrictionRequests=[])
Parameters
Type | Name | Description |
---|---|---|
list | removeAttributeRestrictionRequests | Attribute restrictions to remove". |
Example
attribute1 = cloudshell_api.Attribute("name", "value")
removeRestrictionRequest = cloudshell_api.RemoveRestrictionRequest("familyName", "modelName", [attribute1])
cloudshell_api_session.RemoveAttributeRestrictedValues([removeRestrictionRequest])
RecheckConflictsView which resources are available for a reservation.
Syntax
RecheckConflicts(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
Example
cloudshell_api_session.RecheckConflicts("af626b88-458b-4e7a-9054-c03d8cffa260")
ReleaseResourcesFromReservationRelease occupied testing resources.
Syntax
ReleaseResourcesFromReservation(reservationId, resourcesFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | resourcesFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
Example
cloudshell_api_session.ReleaseResourcesFromReservation("af626b88-458b-4e7a-9054-c03d8cffa260", ["GenericResource 1234", "Router 1234/Port 1"])
ReleaseTopologyResourcesRelease resources used in topology.
Syntax
ReleaseTopologyResources(reservationId, topologyFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | topologyFullPath | Specify topology (name or full path). For full path, specify the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
Example
cloudshell_api_session.ReleaseTopologyResources("af626b88-458b-4e7a-9054-c03d8cffa260", "Temp Automation Resources/TP1")
RemoveGroupsFromDomainRemove groups from a domain.
Syntax
RemoveGroupsFromDomain(domainName, groupNames=[])
Parameters
Type | Name | Description |
---|---|---|
string | domainName | Specify the name of the domain. |
list | groupNames | Specify an array of one or more groups. |
Example
cloudshell_api_session.RemoveGroupsFromDomain("Global", ["QA_Users"])
RemovePermittedUsersFromReservationRemove permitted users from a reservation.
Syntax
RemovePermittedUsersFromReservation(reservationId, usernames=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | usernames | List of permitted users to remove from the reservation. |
Example
cloudshell_api_session.RemovePermittedUsersFromReservation("2d2f7cde-20g3-4bac-80d2-e8cfhecef45b", ["name1"])
RemoveResourcesFromDomainRemove resources from a domain.
Syntax
RemoveResourcesFromDomain(domainName, resourcesNames=[])
Parameters
Type | Name | Description |
---|---|---|
string | domainName | Specify the name of the domain. |
list | resourcesNames | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
Example
cloudshell_api_session.RemoveResourcesFromDomain("Global", ["Router 1234", "GenericResource 1234"])
RemoveResourcesFromReservationRemove resources from a reservation.
Syntax
RemoveResourcesFromReservation(reservationId, resourcesFullPath=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | resourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
boolean | deleteDeployedApps | Specify false to block deletion of deployed apps when removing them from reservation - only applies to resources of that are deployed apps, when applied to other resources argument is ignored. Parameter is optional and can be left empty |
Example
cloudshell_api_session.RemoveResourcesFromReservation("af626b88-458b-4e7a-9054-c03d8cffa260", ["Router 1234", "GenericResource 1234"])
RemoveConnectorsFromReservationRemove connectors from a reservation.
Syntax
RemoveConnectorsFromReservation(reservationId, endpoints=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | endpoints | The list of removed endpoints. |
Example
cloudshell_api_session.RemoveConnectorsFromReservation("af626b88-458b-4e7a-9054-c03d8cffa260", ["Router 1234/Port 1", "GenericResource 1234/Port 1"])
RemoveRoutesFromReservationRemove routes from a reservation.
Syntax
RemoveRoutesFromReservation(reservationId, endpoints=[], mappingType)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | endpoints | The list of removed endpoints. |
string | mappingType | Specify bidirectional or unidirectional as the mapping type. |
Example
cloudshell_api_session.RemoveRoutesFromReservation("af626b88-458b-4e7a-9054-c03d8cffa260", ["Router 1234/Port 1", "GenericResource 1234/Port 1"], "bi")
RemoveTopologiesFromDomainRemoves a list of one or more topologies from a domain.
Syntax
RemoveTopologiesFromDomain(domainName, topologyNames=[])
Parameters
Type | Name | Description |
---|---|---|
string | domainName | Specify the name of the domain. |
list | topologyNames | Specify a list of topology names. Include the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
Example
cloudshell_api_session.RemoveTopologiesFromDomain("Global", ["Topology1"])
RemoveUsersFromGroupRemove users from a group.
Syntax
RemoveUsersFromGroup(usernames=[], groupName)
Parameters
Type | Name | Description |
---|---|---|
list | usernames | Specify an array of one or more users. |
string | groupName | Specify the name of the group. |
Example
cloudshell_api_session.RemoveUsersFromGroup(["User1234", "User2345"], "QA_Users")
RemoveTopologyCategoryRemoves a category from given topology.
Syntax
RemoveTopologyCategory(topologyFullPath, categoryName)
Parameters
Type | Name | Description |
---|---|---|
string | topologyFullPath | Specify the topology (name or full path), from which to remove the category. For full path, specify the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
string | categoryName | Specify the category's name which we want to remove. |
Example
cloudshell_api_session.RemoveTopologyCategory("myDir/myTopology", "lookUpCategory")
MoveResourcesMove multiple resources.
Syntax
MoveResources(resourcesName=[], targetFolder)
Parameters
Type | Name | Description |
---|---|---|
list | resourcesName | Specify the name of the root resources to move to the new target folder. |
string | targetFolder | The path of the target folder. |
Example
cloudshell_api_session.MoveResources(["Router 1234", "Generic Resource 1234"], "root/destinationFolder")
RenameResourceRename a resource.
Syntax
RenameResource(resourceFullPath, resourceName)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | resourceName | Specify a new resource name. |
Example
cloudshell_api_session.RenameResource("Router 1234", "Router 4321")
ResetResourceDriverReset a resource driver and cancel its commands.
Syntax
ResetResourceDriver(reservationId, resourceFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
Example
cloudshell_api_sessionResetResourceDriver("af626b88-458b-4e7a-9054-c03d8cffa260", "Router 1234")
RemoveAppFromReservationRemove app resource from existing reservation.
Syntax
RemoveAppFromReservation(reservationId, appName)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | appName | Specify the name of the App. |
Example
cloudshell_api_session.RemoveAppFromReservation("077e6b4f-5e70-46b5-aa4b-43e6f039acc3", "DemoApp")
GetAppsDetailsInReservationRetrieves information on Apps in the reservation.
Syntax
GetAppsDetailsInReservation(reservationId, appNames=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | appNames | Specify the name of the Apps. |
Example
cloudshell_api_session.GetAppsDetailsInReservation("077e6b4f-5e70-46b5-aa4b-43e6f039acc3", ["App1", "App2"])
RemoveServicesFromReservationRemove services and apps from existing reservation.
Syntax
RemoveServicesFromReservation(reservationId, services=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | services | List of aliases. This list should contain the aliases for both the services and apps that should be removed. |
Example
cloudshell_api_session.RemoveServicesFromReservation("b8ed1fb9-7903-40de-b5b4-f6cba31f6fa0", ["service1", "service2"])
SaveReservationAsTopologyCreate a topology from an existing active reservation.
Syntax
SaveReservationAsTopology(reservationId, folderFullPath, topologyName, includeInactiveRoutes=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | folderFullPath | Full container folder path where the new topology will be saved. leaving the folder path empty will try saving the topology under the root. For example: FolderName/FolderNameA. |
string | topologyName | Specify the new name for the new topology. |
boolean | includeInactiveRoutes | Include disconnected routes in the created topology |
Example
cloudshell_api_session.SaveReservationAsTopology("af626b88-458b-4e7a-9054-c03d8cffa260", "root/topologyFolder", "newTopologyName", True)
SecureLogonLog in to the TestShell service using the AuthToken.
Syntax
SecureLogon(token, domainName='Global')
Parameters
Type | Name | Description |
---|---|---|
string | token | Token to logon with. |
string | domainName | Specify the name of the domain. If no domain is specified, it logs the user in to the global (default) domain. |
Example
cloudshell_api_session.SecureLogon("xoV3libZzEG/ii7ZQqAuqw==", "Global")
SetAttributeValueSet an attribute value.
Syntax
SetAttributeValue(resourceFullPath, attributeName, attributeValue)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | attributeName | Specify the attribute name. |
string | attributeValue | Specify the attribute’s value. |
Example
cloudshell_api_session.SetAttributeValue("Router 1234", "AttributeName", "AttributeValue")
AddValueToLookupAttributeAdds a value to an existing lookup attribute.
Syntax
AddValueToLookupAttribute(attributeName, newValue, makeDefault=False)
Parameters
Type | Name | Description |
---|---|---|
string | attributeName | Specify the attribute's name. |
string | newValue | Specify the value to add to the attribute. |
string | makeDefault | Set the new value as the attribute's default value. |
Example
cloudshell_api_session.AddValueToLookupAttribute("SW_Version", "1.3", makeDefault=True)
RemoveValueFromLookupAttributeRemoves an existing value from a given lookup attribute.
Syntax
RemoveValueFromLookupAttribute(attributeName, removeValue, defaultValue=None)
Parameters
Type | Name | Description |
---|---|---|
string | attributeName | Specify the lookup attribute name. |
string | removeValue | Specify the attribute value to remove from the attribute. |
string | defaultValue | Specify the new default value for this attribute (required if removing the attribute's current default value). |
Example
cloudshell_api_session.RemoveValueFromLookupAttribute("SW_Version", "1.3", defaultValue="1.2")
GetValuesForLookupAttributeRetrieve the values for a lookup attribute.
Syntax
GetValuesForLookupAttribute(attributeName)
Parameters
Type | Name | Description |
---|---|---|
string | attributeName | Specify the lookup attribute name. |
Example
cloudshell_api_session.GetValuesForLookupAttribute("My Lookup Attribute")
SetAttributesValuesSets new attribute values for the specified resources.
Syntax
SetAttributesValues(resourcesAttributesUpdateRequests=[])
Parameters
Type | Name | Description |
---|---|---|
list | resourcesAttributesUpdateRequests | Specify a list of resources, attribute names, and new attribute values (up to 10000 rows). For example: [ResourceAttributesUpdateRequest('resourceFullName', [AttributeNameValue('attribute_name', 'attribute_value')]] |
Example
attribute1 = cloudshell_api.AttributeNameValue("attribute1", "value1")
attribute2 = cloudshell_api.AttributeNameValue("attribute2", "value2")
attributeUpdateRequests = cloudshell_api.ResourceAttributesUpdateRequest("Router 1234", [attribute1, attribute2])
cloudshell_api_session.SetAttributesValues(attributeUpdateRequests)
SetSandboxDataSet the sandbox data
Syntax
SetSandboxData(reservationId, sandboxDataKeyValues=[])
Parameters
Type | Name | Description |
---|
Example
key_value1 = cloudshell_api.SandboxDataKeyValue('ExampleKey1', 'ExampleValue1')
key_value2 = cloudshell_api.SandboxDataKeyValue('ExampleKey2', 'ExampleValue2')
list_all_data = [key_value1, key_value2]
cloudshell_api_session.SetAttributesValues('28cb2a71-c8fc-4f41-a22b-e65685ebed14', list_all_data)
GetSandboxDataGet the sandbox data
Syntax
GetSandboxData(reservationId)
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.GetSandboxData('28cb2a71-c8fc-4f41-a22b-e65685ebed14')
ClearSandboxDataClear the sandbox data
Syntax
ClearSandboxData(reservationId)
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.ClearSandboxData('28cb2a71-c8fc-4f41-a22b-e65685ebed14')
SetBaudRateSet console port baud rate.
Syntax
SetBaudRate(reservationId, resourceFullPath, consolePortsFullPath=[], baudRate=0)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
list | consolePortsFullPath | Specify a list of console ports according to their location in the Resource Explorer. Include the full path from the root to each console port, separated by slashes. For example: Console/Ports/PortName. |
string | baudRate | Specify the baud rate to apply to the ports. |
Example
cloudshell_api_session.SetBaudRate("af626b88-458b-4e7a-9054-c03d8cffa260", "GenericResource 1234", ["GenericResource 1234/ConsolePort 21"], 9600)
SetConsoleForXModemSet a console for Xmodem.
Syntax
SetConsoleForXModem(reservationId, resourceFullPath ,consolePortsFullPath=[], baudRate=0)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
list | consolePortsFullPath | Specify a list of console ports according to their location in the Resource Explorer. Include the full path from the root to each console port, separated by slashes. For example: Console/Ports/PortName. |
string | baudRate | Specify the baud rate to apply to the ports. |
Example
cloudshell_api_session.SetConsoleForXModem("af626b88-458b-4e7a-9054-c03d8cffa260", "GenericResource 1234", ["GenericResource 1234/ConsolePort 21"], 9600)
SetResourceLiveStatusSets the live status of a resource.
Syntax
SetResourceLiveStatus(resourceFullPath, liveStatusName, additionalInfo)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullName | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA. |
string | liveStatusName | Resource live status name |
string | additionalInfo | Resource live status additional info |
Example
cloudshell_api_session.SetResourceLiveStatus("Generic Resource 1234", "Online", "Resource was responding to pings at 12/12/2013 10:35 AM")
SetReservationLiveStatusSets the live status of the reservation.
Syntax
SetReservationLiveStatus(reservationId, liveStatusName, additionalInfo)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specifies the string that represents the reservation’s unique identifier. |
string | liveStatusName | Reservation live status name |
string | additionalInfo | Reservation live status additional info |
Example
cloudshell_api_session.SetReservationLiveStatus("DCFF5355-58F9-41F8-ABD0-2E666AC9B0FB", "Pass", "Reservation was responding to pings at 12/12/2013 10:35 AM")
SetResourceSharedStateSet the resource sharing state.
Syntax
SetResourceSharedState(reservationId, resourcesFullName=[], isShared=False);
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | resourcesFullName | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
boolean | isShared | Specify whether to allow sharing of the resource. |
Example
cloudshell_api_session.SetResourceSharedState("af626b88-458b-4e7a-9054-c03d8cffa260", ["Router 1234", "GenericResource 1234"], True)
SetRouteAttributesSet a route's attributes.
Syntax
SetRouteAttributes(reservationId, sourceResourceFullPath, targetResourceFullPath, applyChangesTo, attributeRequests=[]);
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | sourceResourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | targetResourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | applyChangesTo | Specify on which resources to apply the attribute changes: Source/Target/All.Source refers to the resource connected to the source endpoint of the route. Target refers to the resource connected to the target endpoint of the route. All encompasses all route resources. |
list | attributeRequests | Specify an array of attributes and associated attribute values. |
Example
cloudshell_api_session.SetRouteAttributes("af626b88-458b-4e7a-9054-c03d8cffa260", "Router 1234/Port 1", "GenericResource 1234/Port 1", "All", ["SW_Version", "1.3"])
SetRouteAttributesViaAliasSet a route's attributes.
Syntax
SetRouteAttributesViaAlias(reservationId, routeAlias, applyChangesTo, attributeRequests=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | routeAlias | Specify the route’s alias. |
string | applyChangesTo | Specify on which resources to apply the attribute changes: Source/Target/All.Source refers to the resource connected to the source endpoint of the route. Target refers to the resource connected to the target endpoint of the route. All encompasses all route resources. |
list | attributeRequests | Specify an array of attributes and associated attribute values. |
Example
cloudshell_api_session.SetRouteAttributesViaAlias("af626b88-458b-4e7a-9054-c03d8cffa260", "route1", "All", ["SW_Version", "1.3"])
SetConnectorAttributesSet a connector's attributes.
Syntax
SetConnectorAttributes(reservationId, sourceResourceFullPath, targetResourceFullPath, attributeRequests=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | sourceResourceFullName | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | targetResourceFullName | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
list | attributeRequests | Specify a matrix of attributes and associated attribute values. |
Example
attribute1 = cloudshell_api.AttributeNameValue("attribute1", "value1")
attribute2 = cloudshell_api.AttributeNameValue("attribute2", "value2")
cloudshell_api_session.SetConnectorAttributes("2623d08d-9d19-4b95-a8dc-d7cca5ea05fb", "Router 1234/Port 1", "GenericResource 1234/Port 1", [attribute1, attribute2])
SetConnectorAttributesViaAliasSet a connector's attributes.
Syntax
SetConnectorAttributesViaAlias(reservationId, connectorAlias, attributeRequests=[]);
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | connectorAlias | Specify the connector’s alias. |
list | attributeRequests | Specify a matrix of attributes and associated attribute values. |
Example
attribute1 = cloudshell_api.AttributeNameValue("attribute1", "value1")
attribute2 = cloudshell_api.AttributeNameValue("attribute2", "value2")
cloudshell_api_session.SetConnectorAttributes("2623d08d-9d19-4b95-a8dc-d7cca5ea05fb", "connectorAlias", [attribute1, attribute2])
SetGroupDomainPermissionsSet the permission level of a group in domain.
Syntax
SetGroupDomainPermissions(domainName, groupName, viewOnly=False);
Parameters
Type | Name | Description |
---|---|---|
string | domainName | Specify the name of the domain. |
string | groupName | Specify the group name. |
boolean | viewOnly | Specify if the group should be have view only permissions. |
Example
cloudshell_api_session.SetGroupDomainPermissions("Global", "RND_Users", True)
SetConnectorsInReservationReserve specified connectors.
Syntax
SetConnectorsInReservation(reservationId, connectors=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | connectors | List of connectors to set in the reservation. For example: [SetConnectorRequest('SourceResourceFullPath', 'TargetResourceFullPath', 'Direction', 'Alias')] |
Example
connectRequest = cloudshell_api.SetConnectorRequest("bridge1/port1", "bridge2/port1", "bi", "some alias")
cloudshell_api_session.SetConnectorsInReservation("28cb2a71-c8fc-4f41-a22b-e65685ebed14", [connectRequest])
SetTopologyCategorySets a category to a topology.
Syntax
SetTopologyCategory(topologyFullPath, categoryName, categoryValue)
Parameters
Type | Name | Description |
---|---|---|
string | topologyFullPath | Specify the topology (name or full path), to associate the category to. For full path, specify the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
string | categoryName | Specify the category's name which we want to set |
string | categoryValue | Specify the category's value |
Example
cloudshell_api_session.SetTopologyCategory("dir1/myTopology", "lookUpCategory", "bonjour")
SyncResourceFromDeviceUpdate a resource with current device settings and mappings.
Syntax
SyncResourceFromDevice(resourceFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
Example
cloudshell_api_session.SyncResourceFromDevice("L1 Switch 1234")
SyncResourceToDeviceUpdate device settings and mappings from the resource.
Syntax
SyncResourceToDevice(resourceFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
Example
cloudshell_api_session.SyncResourceToDevice("L1 Switch 1234")
SetReservationResourcePositionSet resource position in a reservation.
Syntax
SetReservationResourcePosition(reservationId, resourceFullPath, x=0, y=0)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | resourceFullName | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName. |
string | x | Specify the x coordinate of the resource's top left corner. |
string | y | Specify the y coordinate of the resource's top left corner. |
Example
cloudshell_api_session.SetReservationResourcePosition("af626b88-458b-4e7a-9054-c03d8cffa260", "Router 1234", 100, 100)
SetServiceDriverSets a service model driver.
Syntax
SetServiceDriver(serviceName, driverName)
Parameters
Type | Name | Description |
---|---|---|
string | serviceName | Specify the name of the service model. |
string | driverName | Specify the name of the driver. |
Example
cloudshell_api_session.SetServiceDriver("Example_service", "NewDriver")
SetServiceLiveStatusSets the live status of a service.
Syntax
SetServiceLiveStatus(reservationId, serviceAlias, liveStatusName, additionalInfo)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation's unique identifier. |
string | serviceAlias | Specify the string that represents the service's alias. |
string | liveStatusName | Resource live status name |
string | additionalInfo | Resource live status additional info |
Example
cloudshell_api_session.SetServiceLiveStatus("0e937c16-2865-4ad1-b843-aa7608282e56", "My Service", "Online", "Resource was responding to pings at 12/12/2013 10:35 AM")
SetServiceNameEdit Service alias name
Syntax
SetServiceName(reservationId, serviceName, newServiceName)
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.SetServiceName("0e937c16-2865-4ad1-b843-aa7608282e56", "My Name", "My New Name")
SetReservationServicePositionSet service position in a reservation.
Syntax
SetReservationServicePosition(reservationId, serviceAlias, x=0, y=0)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | serviceAlias | Specify the alias of the service. |
string | x | Specify the x coordinate of the resource's top left corner. |
string | y | Specify the y coordinate of the resource's top left corner. |
Example
cloudshell_api_session.SetReservationServicePosition("af626b88-458b-4e7a-9054-c03d8cffa260", "My_Service", 100, 100)
SetServiceAttributesValuesSet a resource's attributes.
Syntax
SetServiceAttributesValues(reservationId, serviceAlias, attributeRequests=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | serviceAlias | Specify the service name. |
list | attributeRequests | Specify a matrix of attributes and associated attribute values. |
Example
attribute1 = cloudshell_api.AttributeNameValue("attribute1", "value1")
attribute2 = cloudshell_api.AttributeNameValue("attribute2", "value2")
cloudshell_api_session.SetServiceAttributesValues("2623d08d-9d19-4b95-a8dc-d7cca5ea05fb", "My_Service", [attribute1, attribute2])
TerminateReservationTerminate a reservation.
Syntax
TerminateReservation(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
Example
cloudshell_api_session.TerminateReservation("af626b88-458b-4e7a-9054-c03d8cffa260")
UnlockResourceUnlock a resource.
Syntax
UnlockResource(reservationId, resourceFullPath)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
Example
cloudshell_api_session.UnlockResource("af626b88-458b-4e7a-9054-c03d8cffa260", "GenericResource 1234/Port 1")
UnlockResourcesUnlock multiple resources.
Syntax
UnlockResources(reservationId, resourcesFullPath=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | resourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
Example
cloudshell_api_session.UnlockResources("af626b88-458b-4e7a-9054-c03d8cffa260", ["GenericResource 1234/Port 1"])
UnMapPortsRemove mapping for a pair of mapped ports.
Syntax
UnMapPorts(portA, portB)
Parameters
Type | Name | Description |
---|---|---|
string | portA | Specify the source port. (i.e. Folder1/Chassis1/Blade1/Port1). |
string | portB | Specify the destination port. (i.e. Folder1/Chassis1/Blade1/Port1). |
Example
cloudshell_api_session.UnMapPorts("L1 Switch 1234/Blade 1/Port 1", "L1 Switch 1234/Blade 1/Port 3")
UpdateConnectorAliasInReservationUpdate connector alias in reservation.
Syntax
UpdateConnectorAliasInReservation(reservationId, sourceResourceFullName, targetResourceFullName, direction, alias);
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | sourceResourceFullName | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | targetResourceFullName | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | direction | Specify bidirectional or unidirectional as the connector direction. |
string | alias | Specify the connector’s alias. |
Example
cloudshell_api_session.UpdateConnectorAliasInReservation("2623d08d-9d19-4b95-a8dc-d7cca5ea05fb", "Router 1234/Port 1", "GenericResource 1234/Port 1", "bi", "some alias")
UpdateConnectionWeightUpdate the connection weight between two resources.
Syntax
UpdateConnectionWeight(resourceAFullPath, resourceBFullPath, weight=0)
Parameters
Type | Name | Description |
---|---|---|
string | resourceAFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | resourceBFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
number | weight | Specify a number to represent the connection weight between the specified resources. |
Example
cloudshell_api_session.UpdateConnectionWeight("Router 1234/Port 1", "L1 Switch 1234/Blade 1/Port 3", 5)
UpdateDomainTopologiesFolderUpdate the domain’s topologies folder.
Syntax
UpdateDomainTopologiesFolder(domainName, topologiesFolder)
Parameters
Type | Name | Description |
---|---|---|
string | domainName | Specify the name of the domain. |
string | topologiesFolder | Specify the topology name. Include the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
Example
cloudshell_api_session.UpdateDomainTopologiesFolder("Domain1", "Domain Topologies")
UnarchiveDomainUn archive the domain
Syntax
UnarchiveDomain(domainName)
Parameters
Type | Name | Description |
---|---|---|
string | domainName | Specify the name of the domain. |
Example
cloudshell_api_session.UnarchiveDomain("Domain1")
UpdateGroup
Syntax
UpdateGroup(groupName, newName, description, groupRole)
Parameters
Type | Name | Description |
---|---|---|
string | groupName | Specify the name of the group. |
string | newName | Specify the new group name. |
string | description | Provide a short description of the group. |
string | groupRole | Specify the role of the group, possible values: External, Regular, DomainAdmin or Ignore (to keep the current role). |
Example
cloudshell_api_session.UpdateGroup("QA_Users", "QAUsers", "QA users group", "Regular")
UpdatePhysicalConnectionDefine the physical connection between two resources.
Syntax
UpdatePhysicalConnection(resourceAFullPath, resourceBFullPath, overrideExistingConnections=True)
Parameters
Type | Name | Description |
---|---|---|
string | resourceAFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | resourceBFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. You may leave this parameter blank if you wish to disconnect the existing source resource connection. |
boolean | overrideExistingConnections | Overriding existing connections will automatically remove existing physical connection if they conflict with the requested new connections. If set to 'No', an error message will be displayed if any port is already connected and the operation will be cancelled. |
Example
cloudshell_api_session.UpdatePhysicalConnection("Router 1234/Port 1", "L1 Switch 1234/Blade 1/Port 3", True)
UpdatePhysicalConnectionsDefine physical connections between resources.
Syntax
UpdatePhysicalConnections(physicalConnectionsUpdateRequests=[], overrideExistingConnections=True)
Parameters
Type | Name | Description |
---|---|---|
list | physicalConnectionUpdateRequest | Specify a list of physical connections to update. For example: [PhysicalConnectionUpdateRequest('resource_a_fullname', 'resource_b_fullname', 'weight')] |
boolean | overrideExistingConnections | Overriding existing connections will automatically remove existing physical connection if they conflict with the requested new connections. If set to 'No', an error message will be displayed if any port is already connected and the operation will be cancelled. |
Example
connectUpdateRequest = cloudshell_api.PhysicalConnectionUpdateRequest("Router 1234/Port 1", "L1 Switch 1234/Blade 1/Port 3", 5)
cloudshell_api_session.UpdatePhysicalConnections([connectUpdateRequest], True)
RemapConnectionsRemap connections between resources.
Syntax
RemapConnections(reservationId, resourcesFullPath=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | resourcesFullPath | Specify a list of resource names. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/ResourceName |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
cloudshell_api_session.RemapConnections("af626b88-458b-4e7a-9054-c03d8cffa260", ["Router 1234", "GenericResource 1234"], True)
UpdateReservationDescriptionChange a reservation description.
Syntax
UpdateReservationDescription(reservationId, description)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the reservation ID. |
string | description | Provide an updated description of the reservation. This text will replace the current description. |
Example
cloudshell_api_session.UpdateReservationDescription("af626b88-458b-4e7a-9054-c03d8cffa260", "New Description")
UpdateReservationNameChange a reservation name.
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the reservation ID. |
string | name | Provide an updated name of the reservation. This text will replace the current name. |
UpdateReservationGlobalInputsUpdates the unlinked global inputs in a specified reservation.
Syntax
UpdateReservationGlobalInputs(reservationId, globalInputs=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the reservation ID. |
list | globalInputs | Global inputs associated with the specified reservation. For example: [UpdateTopologyGlobalInputsRequest('input1','value1')] |
Example
updateTopologyGlobalInput = cloudshell_api.UpdateTopologyGlobalInputsRequest("ParamName", "Value")
cloudshell_api_session.UpdateReservationGlobalInputs("af626b88-458b-4e7a-9054-c03d8cffa260", [updateTopologyGlobalInput])
ChangeReservationOwnerUpdates the owner in a specified reservation.
Syntax
ChangeReservationOwner(reservationId, ownerName)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the reservation ID. |
string | ownerName | New owner for the reservation. |
Example
cloudshell_api_session.ChangeReservationOwner("af626b88-458b-4e7a-9054-c03d8cffa260", "admin")
UpdateResourceAddressUpdate a resource address.
Syntax
UpdateResourceAddress(resourceFullPath, resourceAddress)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | resourceAddress | Specify the resource’s new address. |
Example
cloudshell_api_session.UpdateResourceAddress("Router 1234", "192.168.1.201")
UpdateResourceDescriptionChange a resource description.
Syntax
UpdateResourceDescription(resourceFullPath, resourceDescription)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | resourceDescription | Provide an updated description of the resource. This text will replace the current description. |
Example
cloudshell_api_session.UpdateResourceDescription("Router 1234", "a new description for the resource")
UpdateResourceDriverUpdate a resource driver.
Syntax
UpdateResourceDriver(resourceFullPath, driverName)
Parameters
Type | Name | Description |
---|---|---|
string | resourceFullPath | Specify the resource name. You can also include the full path from the root to the resource before the resource name, separated by slashes. For example: FolderName/RouterA/Port1. |
string | driverName | Specify the name of the driver. |
Example
cloudshell_api_session.UpdateResourceDriver("Router 1234", "NewDriver")
UpdateTopologyOwnerUpdate the topology owner.
Syntax
UpdateTopologyOwner(topologyName, ownerName)
Parameters
Type | Name | Description |
---|---|---|
string | topologyName | Specify the topology name. Include the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
string | ownerName | Specify the topology owner. |
Example
cloudshell_api_session.UpdateTopologyOwner("Temp Automation Resources/TP1", "admin")
AddPermittedEditorsToTopologyAdd permitted editors to a topology.
Syntax
AddPermittedEditorsToTopology(topologyName, editorNames)
Parameters
Type | Name | Description |
---|---|---|
string | topologyName | Specify the topology name. Include the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
list | editorNames | A list of user names to be added as permitted editors to a topology. |
Example
cloudshell_api_session.AddPermittedEditorsToTopology("Temp Automation Resources/TP1", ["admin", "John Doe"])
RemovePermittedEditorsFromTopologyRemove permitted editors from a topology.
Syntax
RemovePermittedEditorsFromTopology(topologyName, editorNames)
Parameters
Type | Name | Description |
---|---|---|
string | topologyName | Specify the topology name. Include the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
list | editorNames | A list of user names to be removed as permitted editors from a topology. |
Example
cloudshell_api_session.RemovePermittedEditorsFromTopology("Temp Automation Resources/TP1", ["admin", "John Doe"])
UpdateTopologyDriverUpdate the topology driver.
Syntax
UpdateTopologyDriver(topologyFullPath, driverName)
Parameters
Type | Name | Description |
---|---|---|
string | topologyFullPath | Specify topology (name or full path). For full path, specify the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
string | driverName | Specify the name of the driver. Leave empty to remove associated driver. |
Example
cloudshell_api_session.UpdateTopologyDriver("Topologies/Topology1", "New Topology Driver")
RenameBlueprintRename a blueprint.
Syntax
RenameBlueprint(topologyFullPath, newName)
Parameters
Type | Name | Description |
---|---|---|
string | topologyFullPath | Specify the topology name. Include the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName. |
string | newName | Specify the new name of the topology. |
Example
cloudshell_api_session.RenameBlueprint("Topologies/Topology1", "New Name")
UpdateUser
Syntax
UpdateUser(username, email, isActive=False)
Parameters
Type | Name | Description |
---|---|---|
string | username | The username of the user you want to update. |
string | The new email address to update to. | |
boolean | isActive | Grant or deny active access to the application. |
Example
cloudshell_api_session.UpdateUser("User1234", "user1234@work.com", True)
UpdateUsersLimitations
Syntax
UpdateUsersLimitations(userUpdateRequests=[])
Parameters
Type | Name | Description |
---|---|---|
list | userUpdateRequests | List of Username, MaxConcurrentReservations, MaxReservationDuration, MaxSavedSandboxes, MaxScheduledSandboxes, and MaxOwnedBlueprints of the users you wish to update. For example: [UserUpdateRequest('user1','max_reservations','max_duration', 'max_save_sandbox', 'max_scheduled_sandboxes', 'max_owned_blueprints')] |
Example
userUpdateRequest = cloudshell_api.UserUpdateRequest("username", "12", "1440", "20", "10", "10")
cloudshell_api_session.UpdateUsersLimitations([userUpdateRequest])
UpdateUserGroupsModify a user's group memberships.
Syntax
UpdateUserGroups(username, groupsNames=[])
Parameters
Type | Name | Description |
---|---|---|
string | username | Specify the name of the user. |
list | groupsNames | Use this method to update a user's group memberships. Activating this method will replace the user's memberships with the specified list of groups. |
Example
cloudshell_api_session.UpdateUserGroups("User1234", ["QA_Users", "Testers_Users"])
UpdateUserPasswordModify a user's password.
Syntax
UpdateUserPassword(username, newPassword)
Parameters
Type | Name | Description |
---|---|---|
string | username | Specify the name of the user. |
string | password | Specify the user's new login password. |
Example
cloudshell_api_session.UpdateUserPassword("User1234", "Pass1234")
UpdateRouteAliasesInReservationUpdate route aliases in a reservation
Syntax
UpdateRouteAliasesInReservation(reservationId, routeAliases=[])
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specifies the string that represents the reservation’s unique identifier. |
list | routeAliases | Specify a matrix of route source, route target and alias. For example: [UpdateRouteAliasRequest('source_fullname', 'target_fullname', 'alias')] |
Example
updateRouteAliasRequest = cloudshell_api.UpdateRouteAliasRequest("Router 1234/Port 1", "GenericResource 1234/Port 2", "uni route")
cloudshell_api_session.UpdateRouteAliasesInReservation("af626b88-458b-4e7a-9054-c03d8cffa260", [updateRouteAliasRequest])
UpdateDriverUpdate Driver
Syntax
UpdateDriver(driverName, pathToDriver)
Parameters
Type | Name | Description |
---|---|---|
string | driverName | Specify the driver name. |
string | driverFileName | Specify the driver file name/full path. |
Example
cloudshell_api_session.UpdateDriver("TestDriver", "C:/TestDriver_Update.zip")
UpdateScriptUpdate Script
Syntax
UpdateScript(scriptName, pathToScript)
Parameters
Type | Name | Description |
---|---|---|
string | scriptName | Specify the script name. |
string | scriptFile | Specify the script file data (base64 file representation). |
string | scriptFileName | Specify the script file name(optional). |
Example
cloudshell_api_session.UpdateScript("TestScript", "C:\TestScript_Update.zip")
WriteMessageToReservationOutputAllows sending output to the command output window in a reservation.
Syntax
WriteMessageToReservationOutput(reservationId, message)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | message | Output message to the command output window. |
Example
cloudshell_api_session.WriteMessageToReservationOutput("2623d08d-9d19-4b95-a8dc-d7cca5ea05fb", "this is an output from API")
SetSetupStage
Syntax
SetSetupStage(setupStage, reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | setupStage | Specify the setup stage that will be set to the reservation. |
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
Example
cloudshell_api_session.SetSetupStage("Provisioning", "af626b88-458b-4e7a-9054-c03d8cffa260")
ResetSandboxProvisioningStatus
Syntax
ResetSandboxProvisioningStatus(reservationId)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
Example
cloudshell_api_session.ResetSandboxProvisioningStatus("af626b88-458b-4e7a-9054-c03d8cffa260")
SaveSandbox
Syntax
SaveSandbox(reservationId, savedSandboxName, savedSandboxDescription, owner)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
string | savedSandboxName | Specify the name of the saved sandbox |
string | savedSandboxDescription | provide a short description for the saved sandbox |
string | owner | Specify the owner of the saved sandbox |
string | savedSandboxId | Returns the saved sandbox id |
Example
cloudshell_api_session.SaveSandbox("af626b88-458b-4e7a-9054-c03d8cffa260", "SandboxName", "This is a saved sandbox", "admin")
RestoreSavedSandbox
Syntax
RestoreSavedSandbox(reservationName, owner, durationInMinutes=0, notifyOnStart=False, notifyOnSetupComplete=False, notifyOnEnd=False, notificationMinutesBeforeEnd=0, SavedSandboxId, startTime, endTime)
Parameters
Type | Name | Description |
---|---|---|
string | reservationName | Specify the name of the reservation. |
string | owner | Specify the user name of the reservation owner. |
number | durationInMinutes | Specify the length of the reservation. (in minutes) |
boolean | notifyOnStart | Indicate whether to notify the reservation owner when the reservation starts. |
boolean | notifyOnEnd | Indicate whether to notify the reservation owner when the reservation ends. |
number | notificationMinutesBeforeEnd | Indicate the number of minutes before the end of the reservation to send out a Notify On End alert to the reservation owner. (0 = disabled) |
string | savedSandboxId | Specify the saved sandbox id. |
string | startTime | The start time of the restored sandbox. |
string | endTime | The end time of the restored sandbox. |
boolean | notifyOnSetupComplete | Indicate whether to notify the reservation owner when the reservation setup completes. |
boolean | isTerminationProtectionEnabled | Indicate whether to protect the reservation from being terminated. |
Example
cloudshell_api_session.RestoreSavedSandbox("Restored Reservation", "admin", 0, True, True, 15, "af626b88-458b-4e7a-9054-c03d8cffa260", "2015-01-01T10:00:00", "2015-01-01T11:00:00", True)
GetSavedSandboxes
Syntax
GetSavedSandboxes()
Example
cloudshell_api_session.GetSavedSandboxes()
DeleteSavedSandbox
Syntax
DeleteSavedSandbox(savedSandboxId)
Parameters
Type | Name | Description |
---|---|---|
string | savedSandboxId | Specify the saved sandbox id |
Example
cloudshell_api_session.DeleteSavedSandbox("af626b88-458b-4e7a-9054-c03d8cffa260")
SetAppSecurityGroupsSet security groups for apps
Syntax
SetAppsSecurityGroups(reservationId, securityGroups=[], printOutput=False)
Parameters
Type | Name | Description |
---|---|---|
string | reservationId | Specify the string that represents the reservation’s unique identifier. |
list | securityGroups | Security Groups |
boolean | printOutput | Defines whether to print the command output in the reservation command output window. |
Example
securityGroupRule = cloudshell_api.SecurityGroupRule("fromPort", "toPort", "protocol", "source")
securityGroupConfiguration = cloudshell_api.SecurityGroupConfiguration("subnetId", [securityGroupRule])
securityGroup = cloudshell_api.SecurityGroup("Security GroupName", [securityGroupConfiguration])
cloudshell_api_session.SetAppsSecurityGroups("af626b88-458b-4e7a-9054-c03d8cffa260", securityGroups=[securityGroup], True)
GetAllApprovalRequestsGet all approval requests.
Syntax
GetAllApprovalRequests()
Parameters
Type | Name | Description |
---|
Example
cloudshell_api_session.GetAllApprovalRequests()
GetApprovalRequestGet Approval request.
Syntax
GetApprovalRequest(id)
Parameters
Type | Name | Description |
---|---|---|
number | id | Specify the number that represents the request’s unique identifier. |
Example
cloudshell_api_session.GetApprovalRequest()
CreateBlueprintApprovalRequestCreate a new blueprint approval request.
Syntax
CreateBlueprintApprovalRequest(entityId, requestNotes="", globalInputs=[], requirementsInputs=[], additionalInfoInputs=[], startTime="", endTime="", duration="")
Parameters
Type | Name | Description |
---|---|---|
string | entityId | Unique identifier of the entity (Blueprint id). |
string | requestNotes | Request description (optional). |
list | globalInputs | Global inputs associated with the specified topology. For example: {['Input Name', 'Value';]}. |
list | requirementsInputs | Requirements inputs associated with the specified topology. For example: {['Resource Name', 'Input Name', 'Value', 'AttributeType';]}, AttributeType can be one of the following: Attributes/Models/Quantity. |
list | additionalInfoInputs | Additional info inputs associated with the specified topology. For example: {['Resource Name', 'Input Name', 'Value';]}. |
string | startTime | Start time of the request (leave empty to immediately request approval). |
string | endTime | End time of the request, after which the request will be invalid (leave empty for unlimited request time). |
string | duration | Time in minutes to consume the entity. For example, sandbox duration (leave empty for unlimited consumption time). |
Example
# Create Inputs
globalInput = cloudshell_api.UpdateTopologyGlobalInputsRequest("input1", "value1")
requirementsInput = cloudshell_api.UpdateTopologyRequirementsInputsRequest("Resource1", "input2", "value2", "Attributes")
additionalInfoInput = cloudshell_api.UpdateTopologyAdditionalInfoInputsRequest("Resource2", "input3", "value3")
# Create Request
cloudshell_api_session.CreateBlueprintApprovalRequest("de6f5e37-e3e3-46d0-b915-07a1f30c07d4", "Request notes", globalInputs, requirementsInputs, additionalInfoInputs, "2023-01-01T12:00:00", "2023-02-0212:00:00", "60")
DeleteApprovalRequestDelete an approval request.
Syntax
DeleteApprovalRequest(id)
Parameters
Type | Name | Description |
---|---|---|
number | id | Unique id of the request. |
Example
cloudshell_api_session.DeleteApprovalRequest(3)
ApproveApprovalRequestApprove an approval request.
Syntax
ApproveApprovalRequest(id, message)
Parameters
Type | Name | Description |
---|---|---|
number | id | Unique id of the request. |
string | message | message (optional). |
Example
cloudshell_api_session.ApproveApprovalRequest(3, "approve message")
RejectApprovalRequestReject an approval request.
Syntax
RejectApprovalRequest(id, message)
Parameters
Type | Name | Description |
---|---|---|
number | id | Unique id of the request. |
string | message | message (optional). |
Example
cloudshell_api_session.RejectApprovalRequest(3, message)
ConsumeApprovalRequestConsume an approval request.
Syntax
ConsumeApprovalRequest(id, name, startTime="", endTime="")
Parameters
Type | Name | Description |
---|---|---|
number | id | Unique id of the request. |
string | name | Name for the consumed entity (Sandbox name). |
string | startTime | Start time of the request (leave empty for immediate use). |
string | endTime | End time of the request (leave empty for unlimited duration). |
Example
cloudshell_api_session.ConsumeApprovalRequest(3, "NewReservation", "2023-01-01T14:00:00", "2023-01-0114:30:00")