2022.2.0 TestShell API Python Reference Guide


ActivateTopologyActivate a topology.

Resolves all connectivity requests in the sandbox, and marks unshared resources as "in use".

Syntax

ActivateTopology(reservationId, topologyFullPath)

Parameters

TypeNameDescription
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")

back to TOC

AddGroupsToDomainAdd groups to a domain.

Add groups to a domain.

Syntax

AddGroupsToDomain(domainName, groupNames=[], readOnly=False)

Parameters

TypeNameDescription
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)

back to TOC

AddNewDomainAdds a new domain.

Adds a new domain.

Syntax

AddNewDomain(domainName, description)

Parameters

TypeNameDescription
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.")

back to TOC

AddNewGroupAdd a new group.

Adds a new users group

Syntax

AddNewGroup(groupName, description, groupRole)

Parameters

TypeNameDescription
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")

back to TOC

AddNewUserAdd a new TestShell user.

Configures user login details and permissions. Use AddUsersToGroup to specify the user’s domain access.

Syntax

AddNewUser(username, password, email, isActive=False, isAdmin=False)

Parameters

TypeNameDescription
string username
Specify the name of the user.
string password
Specify the user’s login password.
string email
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)

back to TOC

AddPermittedUsersToReservationAdd permitted users to a reservation.

Add one or more permitted users to the specified reservation.

Syntax

AddPermittedUsersToReservation(reservationId, usernames=[])

Parameters

TypeNameDescription
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"])

back to TOC

AddResourcesToDomainAdd resources to a domain.

Add resources to a domain.

Syntax

AddResourcesToDomain(domainName, resourcesNames=[], includeDecendants=True)

Parameters

TypeNameDescription
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)

back to TOC

AddResourcesToReservationReserve resources for locking.

Reserves resources to be locked.

Syntax

AddResourcesToReservation(reservationId, resourcesFullPath=[], shared=False)

Parameters

TypeNameDescription
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)

back to TOC

AddRoutesToReservationReserve specified routes.

Adds (but does not connect) routes between all pairs of source and target endpoints, adding additional connectivity ports when required. Use ConnectRoutesInReservation to connect the routes.

Syntax

AddRoutesToReservation(reservationId, sourceResourcesFullPath=[], targetResourcesFullPath=[], mappingType, maxHops=0, routeAlias, isShared=False)

Parameters

TypeNameDescription
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)

back to TOC

AddTopologiesToDomainAdds a list of one or more topologies to a domain.

Adds a list of one or more topologies to a domain.

Syntax

AddTopologiesToDomain(domainName, topologyNames=[], validateResourceAvailability=True)

Parameters

TypeNameDescription
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)

back to TOC

AddUsersToGroupAdd users to a group.

Adds a list of one or more users to the specified group.

Syntax

AddUsersToGroup(usernames=[], groupName)

Parameters

TypeNameDescription
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")

back to TOC

AutoLoadOverwrite switch settings with current data.

Overrides the data of a specified L1 switch with current device settings and mappings.

Syntax

AutoLoad(resourceFullPath)

Parameters

TypeNameDescription
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")

back to TOC

AddAttributeRestrictedValuesadd attribute restrictions

add attribute restrictions to family/model

Syntax

AddAttributeRestrictedValues(addAttributeRestrictionRequests=[])

Parameters

TypeNameDescription
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])
			

back to TOC

ArchiveDomainArchive the domain

Archive a domain. All future reservation will be deleted.

Syntax

ArchiveDomain(domainName)

Parameters

TypeNameDescription
string domainName
Specify the name of the domain.

Example

cloudshell_api_session.ArchiveDomain("Domain1")

back to TOC

AddAppToReservationAdd an App resource to an existing reservation.

Add an App resource to an existing reservation.

Syntax

AddAppToReservation(reservationId, appName, deploymentPath, positionX=100, positionY=100)

Parameters

TypeNameDescription
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)

back to TOC

AddServiceToReservationAdd service resource to existing reservation.

Add service resource to existing reservation.

Syntax

AddServiceToReservation(reservationId, serviceName, alias, attributes=[])

Parameters

TypeNameDescription
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])
			

back to TOC

CopyDomainsResourcesCopy resources to a domain.

Copy resources from a list of source domains to a target domain.

Syntax

CopyDomainsResources(domainNameSources=[], domainNameDestination)

Parameters

TypeNameDescription
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")

back to TOC

ClearAndResetConsoleClear and reset consoles.

Clears and resets specified resource console ports.

Syntax

ClearAndResetConsole(reservationId, resourceFullPath, consolePortsFullPath=[], baudRate=0)

Parameters

TypeNameDescription
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)

back to TOC

ConnectRoutesInReservationConnects a list of routes.

Connects requested routes. It locks the resources and adds route mappings. The routes must already exist in the reservation.

Syntax

ConnectRoutesInReservation(reservationId, endpoints=[], mappingType)

Parameters

TypeNameDescription
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")

back to TOC

CreateFolderAdd a new folder.

Adds a new folder to the specified path.

Syntax

CreateFolder(folderFullPath)

Parameters

TypeNameDescription
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")

back to TOC

CreateImmediateReservationCreate an imminent reservation.

Defines a reservation to be started immediately.

Syntax

CreateImmediateReservation(reservationName, owner, durationInMinutes=0, notifyOnStart=False, notifyOnEnd=False, notificationMinutesBeforeEnd=0, isTerminationProtectionEnabled=False)

Parameters

TypeNameDescription
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.

Example

cloudshell_api_session.CreateImmediateReservation("Immediate Res", "admin", 60, True, False, 0, True)

back to TOC

CreateImmediatePersistentReservationCreate an immediate persistent reservation.

Defines a reservation to be started immediately.

Syntax

CreateImmediatePersistentReservation(reservationName, owner, durationInMinutes=0, notifyOnStart=False, notifyOnEnd=False)

Parameters

TypeNameDescription
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)

back to TOC

CreateImmediateTopologyReservationCreate an imminent reservation.

Defines a reservation to be started immediately. The reservation will start regardless of conflicting resources.

Syntax

CreateImmediateTopologyReservation(reservationName, owner, durationInMinutes=0, notifyOnStart=False, notifyOnSetupComplete=False, notifyOnEnd=False, notificationMinutesBeforeEnd=0, topologyFullPath, globalInputs=[], requirementsInputs=[], additionalInfoInputs=[])

Parameters

TypeNameDescription
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)
			

back to TOC

CreateReservationCreate a reservation.

Defines a new reservation.

Syntax

CreateReservation(reservationName, owner, startTime, endTime, notifyOnStart=False, notifyOnEnd=False, notificationMinutesBeforeEnd=0)

Parameters

TypeNameDescription
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.

Example

cloudshell_api_session.CreateReservation("Res1", "admin", "2015-01-01T10:00:00", "2015-01-01T11:00:00", True, False, 0)

back to TOC

CreatePersistentReservationCreate a reservation.

Defines a new reservation.

Syntax

CreatePersistentReservation(reservationName, owner, startTime, notifyOnStart=False, notifyOnEnd=False)

Parameters

TypeNameDescription
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)

back to TOC

CreateTopologyReservationCreate a reservation.

Defines a new reservation.

Syntax

CreateTopologyReservation(reservationName, owner, startTime, endTime, notifyOnStart=False, notifyOnSetupComplete=False, notifyOnEnd=False, notificationMinutesBeforeEnd=0, topologyFullPath, globalInputs=[], requirementsInputs=[], additionalInfoInputs=[])

Parameters

TypeNameDescription
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)
			

back to TOC

CreateResourceAdd a new resource.

Adds a new resource.

Syntax

CreateResource(resourceFamily, resourceModel, resourceName, resourceAddress, folderFullPath, parentResourceFullPath, resourceDescription)

Parameters

TypeNameDescription
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")
			

back to TOC

CreateResourcesAdds new resources.

Adds new resources.

Syntax

CreateResources(resourceInfoDtos=[])

Parameters

TypeNameDescription
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])
			

back to TOC

CreateRouteInReservationCreate a route between two resources.

Creates a route between the specified source and target resources.

Syntax

CreateRouteInReservation(reservationId, sourceResourceFullPath, targetResourceFullPath, overrideActiveRoutes=False, mappingType, maxHops=0, routeAlias, isShared=False)

Parameters

TypeNameDescription
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)

back to TOC

CreateRoutesInReservationCreate routes between the listed source and target resources.

Create routes between the listed source and target resources. Routes will be created for each pair of source and target resources.

Syntax

CreateRouteInReservation(reservationId, sourceResourcesFullPath=[], targetResourcesFullPath=[], overrideActiveRoutes=False, mappingType, maxHops=0, routeAlias, isShared=False)

Parameters

TypeNameDescription
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)

back to TOC

DeleteDomainDeletes a domain.

Deletes a domain.

Syntax

DeleteDomain(domainName)

Parameters

TypeNameDescription
string domainName
Specify the name of the domain.

Example

cloudshell_api_session.DeleteDomain("Domain 1")

back to TOC

DeleteTopologyDelete a topology.

Deletes the specified topology.

Syntax

DeleteTopology(topologyFullPath)

Parameters

TypeNameDescription
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")

back to TOC

DeleteFolderDelete a folder.

Deletes the specified folder.

Syntax

DeleteFolder(folderFullPath)

Parameters

TypeNameDescription
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")

back to TOC

DeleteGroupDelete a group.

Deletes the specified group.

Syntax

DeleteGroup(groupName)

Parameters

TypeNameDescription
string groupName
Specify the name of the group.

Example

cloudshell_api_session.DeleteGroup("QA_Users")

back to TOC

DeleteReservationDelete a reservation.

Deletes the specified reservation. Important: DeleteReservation does not perform teardown and therefore does not revert and clean up the sandbox environment.

Syntax

DeleteReservation(reservationId, unmap=False)

Parameters

TypeNameDescription
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)

back to TOC

DeleteResourceDelete a resource.

Deletes the specified resource.

Syntax

DeleteResource(resourceFullPath)

Parameters

TypeNameDescription
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")

back to TOC

DeleteResourcesDeletes the specified resources.

Deletes the specified resources.

Syntax

DeleteResources(resourcesFullPath=[])

Parameters

TypeNameDescription
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"])

back to TOC

DeleteUserDeletes a user.

Deletes the specified user.

Syntax

DeleteUser(username)

Parameters

TypeNameDescription
string username
Specify the name of the user.

Example

cloudshell_api_session.DeleteUser("User1234")

back to TOC

DisconnectRoutesInReservationDisconnects a list of routes.

Disconnects requested routes. It unlocks the resources (if locked), and removes route mappings, but does not remove the route resources from the reservation.

Syntax

DisconnectRoutesInReservation(reservationId, endpoints=[])

Parameters

TypeNameDescription
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"])

back to TOC

DecryptPasswordDecrypt a password.

Decrypt a password.

Syntax

DecryptPassword(encryptedString)

Parameters

TypeNameDescription
string encryptedString
The encrypted string for decryption.

Example

cloudshell_api_session.DecryptPassword("abc")

back to TOC

DeleteResourceTemplateDeletes a specific resource template.

Deletes a specific resource template.

Syntax

DeleteResourceTemplate(resourceTemplateName)

Parameters

TypeNameDescription
string resourceTemplateName
Specify the resource template name.

Example

cloudshell_api_session.DeleteResourceTemplate("Resource Template 4 tests")

back to TOC

EndReservationEnd a reservation.

Ends the specified reservation and optionally, unlocks and releases all reservation resources.

Syntax

EndReservation(reservationId, unmap=False)

Parameters

TypeNameDescription
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)

back to TOC

ExcludeResourceExclude a resource.

Excludes a specified resource.

Syntax

ExcludeResource(resourceFullPath)

Parameters

TypeNameDescription
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")

back to TOC

ExcludeResourcesExcludes the specified resources.

Excludes the specified resources.

Syntax

ExcludeResources(resourcesFullPath=[])

Parameters

TypeNameDescription
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"])

back to TOC

SetResourceVisibilitySet the resource visibility state.

Set the resource visibility State - Admin Only, Everyone or Family Default.

Syntax

SetResourceVisibility(resourceFullPath, newVisibility)

Parameters

TypeNameDescription
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")

back to TOC

SetResourceShareLevel

Sets a resource's default share level.

Syntax

SetResourceShareLevel(resourceFullPath, newShareLevel)

Parameters

TypeNameDescription
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")

back to TOC

EnqueueResourceCommand

[Deprecated] Enqueues a command to be executed for the specified driver.

Syntax

EnqueueResourceCommand(reservationId, resourceFullPath, commandName, parameterValues=[], printOutput=False)

Parameters

TypeNameDescription
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)

back to TOC

EnqueueServiceCommand

[Deprecated] Enqueues a command to be executed for the specified driver.

Syntax

EnqueueServiceCommand(reservationId, serviceAlias, commandName, parameterValues=[], printOutput=False)

Parameters

TypeNameDescription
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)

back to TOC

ExecuteResourceCommand

[Deprecated] Executes a command for the specified driver.

Syntax

ExecuteResourceCommand(reservationId, resourceFullPath, commandName, parameterValues=[], printOutput=False)

Parameters

TypeNameDescription
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)

back to TOC

ExecuteResourceConnectedCommand

Executes a command for the specified driver.

Syntax

ExecuteResourceConnectedCommand(reservationId, resourceFullPath, commandName, commandTag, parameterValues=[], connectedPortsFullPath=[], printOutput=False)

Parameters

TypeNameDescription
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)

back to TOC

EnqueueTopologyCommandEnqueue a topology command.

[Deprecated] Enqueues a command to be executed for the specified reservation.

Syntax

EnqueueTopologyCommand(reservationId, commandName, parameterValues=[], printOutput=False)

Parameters

TypeNameDescription
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)

back to TOC

ExecuteTopologyCommandExecute a topology command.

[Deprecated] Executes a command for the specified reservation.

Syntax

ExecuteTopologyCommand(reservationId, commandName, parameterValues=[], printOutput=False)

Parameters

TypeNameDescription
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)

back to TOC

ExtendReservationExtend a reservation.

Extends the duration of the specified reservation.

Syntax

ExtendReservation(reservationId, minutesToAdd=0)

Parameters

TypeNameDescription
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)

back to TOC

ExportFamiliesAndModelsExports the resource families, models, attributes and structure configuration.

Exports the resource families, models, attributes and structure configuration.

Syntax

ExportFamiliesAndModels()

Parameters

TypeNameDescription

Example

cloudshell_api_session.ExportFamiliesAndModels()

back to TOC

ExecuteServiceCommand

[Deprecated] Executes a command for the specified service driver.

Syntax

ExecuteServiceCommand(reservationId, serviceAlias, commandName, parameterValues=[], printOutput=False)

Parameters

TypeNameDescription
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)

back to TOC

DeployAppToCloudProviderDeploy app to cloud provider

Executes deploy command for the specified app driver.

Syntax

DeployAppToCloudProvider(reservationId, appName, commandInputs=[], printOutput=False)

Parameters

TypeNameDescription
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)
			

back to TOC

DeployAppToCloudProviderBulk

Executes deploy command for the specified apps.

Syntax

DeployAppToCloudProviderBulk(reservationId, appNames=[], commandInputs=[])

Parameters

TypeNameDescription
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])
			

back to TOC

RefreshAppInBlueprintsRefresh Apps in multiple blueprints from the App template

Refresh Apps in the list of blueprints. This applies to blueprints in all domains and can be used by system administrators only.

Syntax

RefreshAppInBlueprints(appTemplateName, topologyNames=[])

Parameters

TypeNameDescription
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"])

back to TOC

RefreshVMDetails

Refreshes VM Details on deployed apps.

Syntax

RefreshVMDetails(reservationId, deployedAppNames=[])

Parameters

TypeNameDescription
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"])
			

back to TOC

EditAppsInReservation

Edit Apps in a reservation

Syntax

EditAppsInReservation(reservationId, editAppsRequests=[])

Parameters

TypeNameDescription
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])
			

back to TOC

PrepareSandboxConnectivity

Prepare Sandbox Connectivity

Syntax

PrepareSandboxConnectivity(reservationId)

Parameters

TypeNameDescription
string reservationId
Specify the string that represents the reservation’s unique identifier.

Example

cloudshell_api_session.PrepareSandboxConnectivity("af626b88-458b-4e7a-9054-c03d8cffa260")

back to TOC

CleanupSandboxConnectivity

Cleanup Sandbox Connectivity

Syntax

CleanupSandboxConnectivity(reservationId)

Parameters

TypeNameDescription
string reservationId
Specify the string that represents the reservation’s unique identifier.

Example

cloudshell_api_session.CleanupSandboxConnectivity("af626b88-458b-4e7a-9054-c03d8cffa260")

back to TOC

ConfigureApps

Run Configuration Management scripts for the apps in the blueprint.

Syntax

ConfigureApps(reservationId, appConfigurations=[], printOutput=False)

Parameters

TypeNameDescription
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)
			

back to TOC

ConfigureAppsV2

Run Configuration Management scripts for the apps in the blueprint.

Syntax

ConfigureAppsV2(reservationId, appConfigurations=[], printOutput=False)

Parameters

TypeNameDescription
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)
			

back to TOC

CheckoutFromPoolCheckout from pool

Request to checkout an item from a pool.

Syntax

CheckoutFromPool(selectionCriteriaJson)

Parameters

TypeNameDescription
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'}")
			

back to TOC

GetModelUsageReportGet model usages

Retrieves the model usages information in Resources, Apps, Abstract Resources and Abstract Templates at Blueprints, Blueprints templates and Sandboxes.

Syntax

GetModelUsageReport(modelName)

Parameters

TypeNameDescription
string modelName
Specify the name of the model to retrieve usages for.

Example


				cloudshell_api_session.GetModelUsageReport("modelName")
			

back to TOC

SetCustomShellAttributeAdd a custom attribute to an existing shell

Add a custom attribute to an existing shell model

Syntax

SetCustomShellAttribute(modelName, attributeName, defaultValue, restrictedValues=[])

Parameters

TypeNameDescription

Example


				cloudshell_api_session.SetCustomShellAttribute("modelName", "attributeName", "yes", ["yes", "no"])
			

back to TOC

RemoveCustomShellAttributeRemove a custom attribute from an existing shell

Remove a custom attribute from an existing shell

Syntax

RemoveCustomShellAttribute(modelName, attributeName)

Parameters

TypeNameDescription

Example


				cloudshell_api_session.RemoveCustomShellAttribute("modelName", "attributeName")
			

back to TOC

ReleaseFromPoolRelease from pool

Request to release an item from a pool.

Syntax

ReleaseFromPool(values=[], poolId, reservationId, ownerId)

Parameters

TypeNameDescription
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")
			

back to TOC

EnqueueEnvironmentCommandEnqueue an environment command.

Enqueues a command to be executed for the specified reservation.

Syntax

EnqueueEnvironmentCommand(reservationId, commandName, commandInputs=[], printOutput=False)

Parameters

TypeNameDescription
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)
			

back to TOC

ExecuteEnvironmentCommandExecute an environment command.

Executes a command for the specified reservation.

Syntax

ExecuteEnvironmentCommand(reservationId, commandName, commandInputs=[], printOutput=False)

Parameters

TypeNameDescription
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)
			

back to TOC

EnqueueCommandEnqueue a command.

Enqueues a command to be executed for the specified target.

Syntax

EnqueueCommand(reservationId, targetName, targetType, commandName, commandInputs=[], printOutput=False)

Parameters

TypeNameDescription
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)
			

back to TOC

ExecuteCommandExecute a command.

Executes a command for the specified target.

Syntax

ExecuteCommand(reservationId, targetName, targetType, commandName, commandInputs=[], printOutput=False)

Parameters

TypeNameDescription
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)
			

back to TOC

FindResources

Retrieves resources that match all the specified search parameters, and all reservations associated with the search results.

Syntax

FindResources(resourceFamily, resourceModel, attributeValues=[], showAllDomains=False, resourceFullName, exactName=True, includeSubResources=True, resourceAddress, resourceUniqueIdentifier, maxResults=500, includeExcludedResources=False)

Parameters

TypeNameDescription
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)
			

back to TOC

FindResourcesInTimeRange

Retrieves resources that match all the specified search parameters, and all reservations in the specified time range associated with the search results.

Syntax

FindResourcesInTimeRange(resourceFamily, resourceModel, fromTime, untilTime, attributeValues=[], showAllDomains=False, resourceFullName, exactName=True, includeSubResources=True, resourceAddress, resourceUniqueIdentifier, maxResults=500)

Parameters

TypeNameDescription
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)
			

back to TOC

GetReservationResourcesPositionsGet resource positions in a reservation.

Retrieves the x/y coordinates for all resources in the reservation's diagram.

Syntax

GetReservationResourcesPositions(reservationId)

Parameters

TypeNameDescription
string reservationId
Specify the string that represents the reservation’s unique identifier.

Example

cloudshell_api_session.GetReservationResourcesPositions("af626b88-458b-4e7a-9054-c03d8cffa260")

back to TOC

GetRoutesSolutionGet solution for specified routes.

Calculates possible routes between the supplied endpoints and returns their details, without saving, connecting or modifying the reservation in any way.

Syntax

GetRoutesSolution(reservationId, sourceResourcesFullPath=[], targetResourcesFullPath=[], mappingType, maxHops=0, isShared=False)

Parameters

TypeNameDescription
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)

back to TOC

GenerateUtilizationReportGenerate a utilization report.

Generates a utilization report for the specified resources. To generate a report for all resources, leave the resourceFullName and resourceModel parameters blank.

Syntax

GenerateUtilizationReport(resourceFamilyName, fromDate, toDate, resourceFullName, resourceModelName, includeChildResources=False, groupBy, utilizationReportType)

Parameters

TypeNameDescription
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")
			

back to TOC

GetActiveTopologyNamesRetrieve a user's reserved topologies.

Retrieves all active reserved topologies for the current (logged in) user.

Syntax

GetActiveTopologyNames()

Parameters

TypeNameDescription

Example

cloudshell_api_session.GetActiveTopologyNames()

back to TOC

GetAllUsersDetailsRetrieve all users and user settings.

Retrieves all users and their settings.

Syntax

GetAllUserDetails()

Parameters

TypeNameDescription

Example

cloudshell_api_session.GetAllUsersDetails()

back to TOC

GetAttributeValueRetrieve an attribute's value.

Retrieves the value of the specified attribute

Syntax

GetAttributeValue(resourceFullPath, attributeName)

Parameters

TypeNameDescription
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")

back to TOC

GetCategoriesOfTopologyRetrieves all categories of a given topology.

Retrieves all categories of given topology.

Syntax

GetCategoriesOfTopology(topologyPath)

Parameters

TypeNameDescription
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")
			

back to TOC

GetCurrentReservationsRetrieve current reservations.

Retrieves current reservations for the specified owner. If an owner is not provided, this method retrieves all current reservations.

Syntax

GetCurrentReservations(reservationOwner)

Parameters

TypeNameDescription
string reservationOwner
Specify the user name of the reservation owner.

Example

cloudshell_api_session.GetCurrentReservations("admin")

back to TOC

GetDomainDetailsRetrieves a domain's details including groups, topologies and resources associated with the specified domain.

Retrieves a domain's details including groups, topologies and resources associated with the specified domain.

Syntax

GetDomainDetails(domainName)

Parameters

TypeNameDescription
string domainName
Specify the name of the domain.

Example

cloudshell_api_session.GetDomainDetails("US Domain")

back to TOC

GetFolderContentRetrieve content for a specified path.

Retrieves content for the specified path.

Syntax

GetFolderContent(fullPath, showAllDomains=False)

Parameters

TypeNameDescription
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)

back to TOC

MoveFolderAllows to change the location of a folder (and all its content, including sub folders) in the folder hierarchy.

Move a folder (and all its content, including sub folders) in the folder hierarchy.

Syntax

MoveFolder(originalFolder, targetFolder)

Parameters

TypeNameDescription
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")

back to TOC

GetGroupDomainsRetrieve a group's domains.

Retrieves all domains associated with a group.

Syntax

GetGroupDomains(groupName)

Parameters

TypeNameDescription
string groupName
Specify the name of the group.

Example

cloudshell_api_session.GetGroupDomains("SC Group")

back to TOC

GetGroupsDetailsRetrieve all system groups.

Retrieves all groups, including members, roles and associated domains for each group.

Syntax

GetGroupsDetails()

Parameters

TypeNameDescription

Example

cloudshell_api_session.GetGroupsDetails()

back to TOC

GetLockedResourcesRetrieve a list of locked resources.

Retrieves locked resources for a specific user, a specific computer, or a specific folder. If none of these are specified, this method retrieves the list of locked resources for all users, on all machines, in all folders.

Syntax

GetLockedResources(user, machine, folderFullPath)

Parameters

TypeNameDescription
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", "", "")

back to TOC

GetReservationDetailsRetrieve reservation details and parameters.

Retrieves all details and parameters for a specified reservation, including its resources, routes and route segments, topologies, and reservation conflicts.The data cached for 5 seconds.

Syntax

GetReservationDetails(reservationId)

Parameters

TypeNameDescription
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")

back to TOC

GetReservationAppImageRetrieve the photo of an app template.

Retrieves the photo of an app.

Syntax

GetReservationAppImage(reservationId, appName)

Parameters

TypeNameDescription
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")

back to TOC

GetReservationStatusRetrieve reservation status

Retrieves status for a specified reservation

Syntax

GetReservationStatus(reservationId)

Parameters

TypeNameDescription
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")

back to TOC

GetReservationInputsRetrieves all topology inputs for a specified reservation.

Retrieves all topology inputs for a specified reservation.

Syntax

GetReservationInputs(reservationId)

Parameters

TypeNameDescription
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")

back to TOC

GetReservationRemainingTimeRetrieve the amount of time until the end of a reservation.

Retrieves the number of minutes remaining until the end of a specified reservation. If the reservation is running overtime, the remaining time will be reported as -1 minutes.

Syntax

GetReservationRemainingTime(reservationId)

Parameters

TypeNameDescription
string reservationId
Specify the string that represents the reservation’s unique identifier.

Example

cloudshell_api_session.GetReservationRemainingTime()"af626b88-458b-4e7a-9054-c03d8cffa260"

back to TOC

GetResourceAvailabilityGet resource availability.

Get resource availability for the resources.

Syntax

GetResourceAvailability(resourcesNames=[], showAllDomains=False)

Parameters

TypeNameDescription
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)

back to TOC

GetResourceAvailabilityInTimeRangeGet resource availability during a specific time range.

Get resource availability for the resources in the specified time range.

Syntax

GetResourceAvailabilityInTimeRange(resourcesNames=[], startTime, endTime, showAllDomains=False)

Parameters

TypeNameDescription
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)

back to TOC

GetResourceCommandsRetrieve resource driver commands.

Retrieves driver commands and parameters for a specified resource.

Syntax

GetResourceCommands(resourceFullPath)

Parameters

TypeNameDescription
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")

back to TOC

GetServiceCommandsRetrieve service driver commands.

Retrieves driver commands and parameters for a specified service.

Syntax

GetServiceCommands(serviceName)

Parameters

TypeNameDescription
string serviceName
Specify the service name.

Example

cloudshell_api_session.GetServiceCommands("VLAN")

back to TOC

GetResourceConnectedCommandsRetrieve resource driver commands.

Gets commands which are added to the resource from connected resources such as power or virtualization.

Syntax

GetResourceConnectedCommands(resourceFullPath)

Parameters

TypeNameDescription
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")

back to TOC

GetResourceDetailsRetrieve the resource parameters and attributes.

Retrieves resource descriptions for the specified resource, and a matrix of all its associated attributes and attribute values.

Syntax

GetResourceDetails(resourceFullPath, showAllDomains=False)

Parameters

TypeNameDescription
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)

back to TOC

GetResourceListRetrieve a list of resources for a specified path.

Retrieves resources and resource values for the specified folder path.

Syntax

GetResourceList(folderFullPath)

Parameters

TypeNameDescription
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")

back to TOC

GetResourceLiveStatusGets the live status of a resource.

Gets the live status of the resource.

Syntax

GetResourceLiveStatus(resourceFullPath)

Parameters

TypeNameDescription
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")

back to TOC

GetReservationsLiveStatusGets the live status the reservations.

Gets the live status of the reservations.

Syntax

GetReservationsLiveStatus(reservationsIds=[])

Parameters

TypeNameDescription
list reservationsId
Specifies a string array that represents reservation unique identifiers.

Example

cloudshell_api_session.GetReservationsLiveStatus(["a2f1b35e-3deb-42ee-b70d-78189dd10d56"])

back to TOC

GetResourceMappingsRetrieve current mappings for specified resources.

Retrieves mappings for a list of one or more resources.

Syntax

GetResourceMappings(resources=[])

Parameters

TypeNameDescription
list resources
Specify a list of resources.

Example

cloudshell_api_session.GetResourceMappings(["L1 Switch 1234/Blade 1/Port 2"]

back to TOC

GetRouteSegmentsRetrieves all the ports on the route.

Retrieves all the ports on the route from the selected endpoint to the target endpoint.

Syntax

GetRouteSegments(resource)

Parameters

TypeNameDescription
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")

back to TOC

GetScheduledReservationsRetrieve scheduled reservations for a specified time range.

Retrieves all reservations scheduled between the specified start and end times.

Syntax

GetScheduledReservations(fromTime, untilTime, ownerName)

Parameters

TypeNameDescription
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")

back to TOC

CreateDraftCreate a private draft of a blueprint.

Create a private draft of a blueprint.

Syntax

CreateDraft(topology, newName)

Parameters

TypeNameDescription
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")

back to TOC

PromoteDraftOverrwrite the original blueprint with the draft, and delete the draft.

Overrwrite the original blueprint with the draft, and delete the draft.

Syntax

PromoteDraft(topologyFullPath)

Parameters

TypeNameDescription
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")

back to TOC

DeleteDraftDelete a draft.

Delete a private draft of a blueprint.

Syntax

DeleteDraft(topology)

Parameters

TypeNameDescription
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")

back to TOC

GetServerDateAndTimeRetrieve the server's date and time.

Retrieves the server’s UTC date and time.

Syntax

GetServerDateAndTime()

Parameters

TypeNameDescription

Example

cloudshell_api_session.GetServerDateAndTime()

back to TOC

GetTopologyCommandsRetrieve available topology commands in a reservation.

[Deprecated] Retrieves driver commands and parameters for a specified reservation.

Syntax

GetTopologyCommands(reservationId)

Parameters

TypeNameDescription
string reservationId
Specify the string that represents the reservation’s unique identifier.

Example

cloudshell_api_session.GetTopologyCommands("af626b88-458b-4e7a-9054-c03d8cffa260")

back to TOC

GetEnvironmentCommandsRetrieve available environment commands in a reservation.

Retrieves driver commands and parameters for a specified reservation.

Syntax

GetEnvironmentCommands(reservationId)

Parameters

TypeNameDescription
string reservationId
Specify the string that represents the reservation’s unique identifier.

Example

cloudshell_api_session.GetEnvironmentCommands("af626b88-458b-4e7a-9054-c03d8cffa260")

back to TOC

GetTopologyUrlsRetrieve Topology Urls.

Retrieves topology urls to the blueprint for every domain that the blueprint belongs to.

Parameters

TypeNameDescription
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.
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC

UpdateReservationNameChange a reservation name.

Modifies the name for a specified reservation.

Parameters

TypeNameDescription
string reservationId
Specify the reservation ID.
string name
Provide an updated name of the reservation. This text will replace the current name.
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC
back to TOC