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:
  1. system_name(string) = Name of the system from the datafile
Returns:
  1. 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:
  1. system_name(string) = Name of the UAP system from the datafile
  2. reservation_name(string) = Specify the name of the reservation.
  3. 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
  4. 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:
  1. 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:
  1. system_name(string) = Name of the UAP system from the datafile
  2. reservation_name(string) = Specify the name of the reservation.
  3. 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:
  1. 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:
  1. system_name(string) = Name of the UAP system from the datafile

  2. reservation_name(string) = Specify the name of the reservation.

  3. 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:
  1. 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:
  1. system_name(string) = Name of the UAP system from the datafile
  2. reservation_name(string) = Specify the name of the reservation.
  3. first_endpoint(str) = The first endpoint of the two end points
  4. second_endpoint(str) = The second endpoint of the two end points
  5. mapping_type(str) = Specify bi-directional or uni-directional as the mapping type
Returns:
  1. 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:
  1. system_name(string) = Name of the UAP system from the datafile
  2. reservation_name(string) = Specify the name of the reservation.
  3. duration_in_mins(int) = Specify the length of the reservation.
  4. notify_on_start(bool) = Indicate whether to notify the reservation owner when the reservation starts.
  5. notify_on_end(bool) = Indicate whether to notify the reservation owner when the reservation ends.
  6. 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:
  1. status(bool)= True/False

  2. 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:
  1. system_name(string) = Name of the UAP system from the datafile
  2. reservation_name(string) = Specify the name of the reservation.
  3. source_resource_full_path(string) = Specify the source resource
    full path
  4. target_resource_full_path(string) = Specify the target resource
    full path
  5. mapping_type(string) = Specify bi-directional or uni-directional as the mapping type
  6. max_hops(integer) = The maximum number of allowed hops.
  7. route_alias(string) = Specify the route alias
  8. override_active_routes(bool) = Specify whether the new route
    can override existing routes.
  9. is_shared(bool) = Specify whether these routes are shared.
Returns:
  1. 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:
  1. system_name(string) = Name of the UAP system from the datafile
  2. reservation_name(string) = Specify the name of the reservation.
  3. list_of_source_resources(list) = The list of source resource
    names.
  4. list_of_target_resources(list) = The list of target resource
    names.
  5. override_active_routes(bool) = Specify whether the new route
    can override existing routes.
  6. mapping_type(string) = Specify bi-directional or uni-directional as the mapping type
  7. max_hops(integer) = The maximum number of allowed hops.
  8. route_alias(string) = Specify the route alias
  9. is_shared(bool) = Specify whether these routes are shared.
Returns:
  1. 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:
  1. system_name(string) = Name of the UAP system from the datafile
  2. reservation_name(string) = Specify the name of the reservation.
  3. duration_in_mins(int) = Specify the length of the reservation.
  4. notify_on_start(bool) = Indicate whether to notify the reservation owner when the reservation starts.
  5. notify_on_end(bool) = Indicate whether to notify the reservation owner when the reservation ends.
  6. 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)
  7. 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:
  1. status(bool)= True/False

  2. 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:
  1. system_name(string) = Name of the UAP system from the datafile
  2. reservation_name(string) = Specify the name of the reservation.
  3. first_endpoint(str) = The first endpoint of the two end points
  4. second_endpoint(str) = The second endpoint of the two end points
Returns:
  1. status(bool)= True/False
cs_end_reservation(system_name, reservation_name, unmap)[source]

End the reservation in Cloudshell

Datafile usage:

NA

Arguments:
  1. system_name(string) = Name of the UAP system from the datafile
  2. reservation_name(string) = Specify the name of the reservation.
  3. unmap(bool) = Unmap resources - Specify whether to keep mappings or release mapped resources when deleting the reservation.
Returns:
  1. status(bool)= True/False
cs_get_current_reservation(reservation_owner)[source]

Retrieves current reservations for the specified owner

Datafile usage:

NA

Arguments:
  1. reservation_owner(string) = Specify the user name of the reservation owner.
Returns:
  1. 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:
  1. system_name(string) = Name of the UAP system from the datafile
  2. reservation_name(string) = Specify the name of the reservation.
Returns:
  1. 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:
  1. 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:
  1. status(bool)= True/False
cs_logoff()[source]

To logoff from CS

Datafile usage:

NA

Arguments:

NA

Returns:
  1. 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:
  1. system_name(string) = Name of the UAP system from the datafile
  2. reservation_name(string) = Specify the name of the reservation.
  3. first_endpoint(str) = The first endpoint of the two end points
  4. second_endpoint(str) = The second endpoint of the two end points
  5. mapping_type(string) = Specify bi-directional or uni-directional as the mapping type
Returns:
  1. 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:
  1. system_name(string) = Name of the UAP system from the datafile
  2. reservation_name(string) = Specify the name of the reservation.
  3. list_of_endpoints(list) = The list of endpoints which needs to be removed
  4. mapping_type(string) = Specify bi-directional or uni-directional as the mapping type
Returns:
  1. 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.