Actions.CloudshellActions package¶
Submodules¶
Actions.CloudshellActions.cloudshell_actions module¶
Copyright 2017, Fujitsu Network Communications, Inc. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
class
Actions.CloudshellActions.cloudshell_actions.
CloudShellActions
[source]¶ Bases:
object
Cloudshell wrapper APIs to create reservations, adding topologies and deletion
-
connect_to_cs
(system_name)[source]¶ Logs in to API host using passed user credentials and domain
Datafile usage: NA
Arguments: - system_name(string) = Name of the system from the datafile
Returns: - status(bool)= True/False
-
cs_activate_topology
(system_name, reservation_name, topology_full_path, time_out=60)[source]¶ Activate Topology to reservation in Cloudshell
Datafile usage: NA
Arguments: - system_name(string) = Name of the UAP system from the datafile
- reservation_name(string) = Specify the name of the reservation.
- topology_path(string) = Specify the full topology name. Include the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName
- time_out(int): Before activating topology, we need to check status
- of the reservation. If it is started, then we need to activate the topology. Need to wait for some time before activating topology for reservation status to get started, making the default value of time_out as 60 sec and can change the value depending on number of resources.
Returns: - status(bool)= True/False
-
cs_add_topology_to_reservation
(system_name, reservation_name, topology_full_path)[source]¶ Create the reservation and add topology to the reservation in Cloudshell
Datafile usage: NA
Arguments: - system_name(string) = Name of the UAP system from the datafile
- reservation_name(string) = Specify the name of the reservation.
- topology_full_path(string) = Specify the full topology name. Include the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName
Returns: - status(bool)= True/False
-
cs_add_users_to_reservation
(system_name, reservation_name, list_of_usernames)[source]¶ Add one or more permitted users to the specified reservation.
Datafile usage: NA
Arguments: system_name(string) = Name of the UAP system from the datafile
reservation_name(string) = Specify the name of the reservation.
list_of_usernames(list) = list of usernames to permit access to reservation. For example: To add many users to access the reservation
list_of_usernames = [‘user1’,’user2’,’userx’]
Returns: - status(bool)= True/False
-
cs_connect_routes
(system_name, reservation_name, first_endpoint, second_endpoint, mapping_type)[source]¶ Connects the routes in the cloud shell
Arguments: - system_name(string) = Name of the UAP system from the datafile
- reservation_name(string) = Specify the name of the reservation.
- first_endpoint(str) = The first endpoint of the two end points
- second_endpoint(str) = The second endpoint of the two end points
- mapping_type(str) = Specify bi-directional or uni-directional as the mapping type
Returns: - status(bool) = True/False
-
cs_create_reservation
(system_name, reservation_name, duration_in_mins, notify_on_start, notify_on_end, notify_mins_before_end)[source]¶ Defines a reservation to be created.
This keyword only defines the reservation with all its details by saving the details in the data repository. Actual creation is done by using the cs_add_topology_to_reservation keyword by providing the reservation name to it.
Datafile usage: Tags or attributes to be used in input datafile for the system or subsystem.If both tag and attribute is provided the attribute will be used. 1. username = name of the cloudshell user
Arguments: - system_name(string) = Name of the UAP system from the datafile
- reservation_name(string) = Specify the name of the reservation.
- duration_in_mins(int) = Specify the length of the reservation.
- notify_on_start(bool) = Indicate whether to notify the reservation owner when the reservation starts.
- notify_on_end(bool) = Indicate whether to notify the reservation owner when the reservation ends.
- notify_mins_before_end(int) = Notification Minutes Before End - 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)
Returns: status(bool)= True/False
output_dict = consists of following key value pairs: 1. domain_id: Domain Id returned after login to cloudshell. 2. reservation_id: Reservation Id returned after successful
creation of resources.
-
cs_create_route_in_reservation
(system_name, reservation_name, source_resource_full_path, target_resource_full_path, override_active_routes, mapping_type, max_hops, route_alias, is_shared)[source]¶ Creates routes between the specified source and target resources.
Arguments: - system_name(string) = Name of the UAP system from the datafile
- reservation_name(string) = Specify the name of the reservation.
- source_resource_full_path(string) = Specify the source resource
- full path
- target_resource_full_path(string) = Specify the target resource
- full path
- mapping_type(string) = Specify bi-directional or uni-directional as the mapping type
- max_hops(integer) = The maximum number of allowed hops.
- route_alias(string) = Specify the route alias
- override_active_routes(bool) = Specify whether the new route
- can override existing routes.
- is_shared(bool) = Specify whether these routes are shared.
Returns: - status(bool) = True/False
-
cs_create_routes_in_reservation
(system_name, reservation_name, list_of_source_resources, list_of_target_resources, override_active_routes, mapping_type, max_hops, route_alias, is_shared)[source]¶ - Creates routes between the listed source and target resources.
- Routes will be created for each pair of source and target resources
Arguments: - system_name(string) = Name of the UAP system from the datafile
- reservation_name(string) = Specify the name of the reservation.
- list_of_source_resources(list) = The list of source resource
- names.
- list_of_target_resources(list) = The list of target resource
- names.
- override_active_routes(bool) = Specify whether the new route
- can override existing routes.
- mapping_type(string) = Specify bi-directional or uni-directional as the mapping type
- max_hops(integer) = The maximum number of allowed hops.
- route_alias(string) = Specify the route alias
- is_shared(bool) = Specify whether these routes are shared.
Returns: - status(bool) = True/False
-
cs_create_topology_reservation
(system_name, reservation_name, duration_in_mins, notify_on_start, notify_on_end, notify_mins_before_end, topology_full_path)[source]¶ Defines a reservation to be started immediately
Datafile usage: Tags or attributes to be used in input datafile for the system or subsystem.If both tag and attribute is provided the attribute will be used. 1. username = name of the cloudshell user
Arguments: - system_name(string) = Name of the UAP system from the datafile
- reservation_name(string) = Specify the name of the reservation.
- duration_in_mins(int) = Specify the length of the reservation.
- notify_on_start(bool) = Indicate whether to notify the reservation owner when the reservation starts.
- notify_on_end(bool) = Indicate whether to notify the reservation owner when the reservation ends.
- notify_mins_before_end(int) = Notification Minutes Before End - 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)
- topology_full_path(string) = Specify the full topology name. Include the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName
Returns: status(bool)= True/False
output_dict = consists of following key value pairs: 1. domain_id: Domain Id returned after login to cloudshell. 2. reservation_id: Reservation Id returned after successful
creation of resources.
-
cs_disconnect_routes
(system_name, reservation_name, first_endpoint, second_endpoint)[source]¶ Disconnects the routes in the cloud shell
Arguments: - system_name(string) = Name of the UAP system from the datafile
- reservation_name(string) = Specify the name of the reservation.
- first_endpoint(str) = The first endpoint of the two end points
- second_endpoint(str) = The second endpoint of the two end points
Returns: - status(bool)= True/False
-
cs_end_reservation
(system_name, reservation_name, unmap)[source]¶ End the reservation in Cloudshell
Datafile usage: NA
Arguments: - system_name(string) = Name of the UAP system from the datafile
- reservation_name(string) = Specify the name of the reservation.
- unmap(bool) = Unmap resources - Specify whether to keep mappings or release mapped resources when deleting the reservation.
Returns: - status(bool)= True/False
-
cs_get_current_reservation
(reservation_owner)[source]¶ Retrieves current reservations for the specified owner
Datafile usage: NA
Arguments: - reservation_owner(string) = Specify the user name of the reservation owner.
Returns: - status(bool)= True/False
-
cs_get_reservation_details
(system_name, reservation_name)[source]¶ Retrieves all details and parameters for a specified reservation
Datafile usage: NA
Arguments: - system_name(string) = Name of the UAP system from the datafile
- reservation_name(string) = Specify the name of the reservation.
Returns: - status(bool)= True/False
-
cs_get_topo_details
(topology_path)[source]¶ To get the Cloudshell topology details for a given path
Datafile usage: NA
Arguments: - topology_path(string) = Specify the full topology name. Include the full path from the root to the topology, separated by slashes. For example: FolderName/Topologies/TopologyName
Returns: - status(bool)= True/False
-
cs_logoff
()[source]¶ To logoff from CS
Datafile usage: NA
Arguments: NA
Returns: - status(bool)= True/False
-
cs_remove_route_from_reservation
(system_name, reservation_name, first_endpoint, second_endpoint, mapping_type)[source]¶ - Disconnects two endpoints and removes the mapped route between
- them
Arguments: - system_name(string) = Name of the UAP system from the datafile
- reservation_name(string) = Specify the name of the reservation.
- first_endpoint(str) = The first endpoint of the two end points
- second_endpoint(str) = The second endpoint of the two end points
- mapping_type(string) = Specify bi-directional or uni-directional as the mapping type
Returns: - status(bool) = True/False
-
cs_remove_routes_from_reservation
(system_name, reservation_name, list_of_endpoints, mapping_type)[source]¶ - Disconnects a list of endpoints and removes the mapped route between
- them
Arguments: - system_name(string) = Name of the UAP system from the datafile
- reservation_name(string) = Specify the name of the reservation.
- list_of_endpoints(list) = The list of endpoints which needs to be removed
- mapping_type(string) = Specify bi-directional or uni-directional as the mapping type
Returns: - status(bool) = True/False
-
Module contents¶
Copyright 2017, Fujitsu Network Communications, Inc. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.