How to use the cvpysdk.instances.vsinstance.VirtualServerInstance function in cvpysdk

To help you get started, we’ve selected a few cvpysdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CommvaultEngg / cvpysdk / cvpysdk / instances / vsinstance.py View on Github external
"""Decides which instance object needs to be created"""

        try:
            instance_name = VSINSTANCE_TYPE[agent_object.instances._vs_instance_type_dict[instance_id]]
        except KeyError:
            instance_name = re.sub('[^A-Za-z0-9_]+', '', instance_name.replace(" ", "_"))

        try:
            instance_module = import_module("cvpysdk.instances.virtualserver.{}".format(instance_name))
        except ImportError:
            instance_module = import_module("cvpysdk.instances.virtualserver.null")

        classes = getmembers(instance_module, lambda m: isclass(m) and not isabstract(m))

        for name, _class in classes:
            if issubclass(_class, VirtualServerInstance) and _class.__module__.rsplit(".", 1)[-1] == instance_name:
                return object.__new__(_class)
github CommvaultEngg / cvpysdk / cvpysdk / instances / virtualserver / azurestackinstance.py View on Github external
Instance object associated with the
                                            VirtualServer Instance

    _get_instance_properties()           -- VirtualServer Instance class method
                                            overwritten to get azure Stack
                                            Specific instance properties as well

	_get_instance_properties_json()		 -- get the all instance related
											properties of this subclient.

"""

from ..vsinstance import VirtualServerInstance


class AzureStackInstance(VirtualServerInstance):
    """Class for representing Azure stack instance of the Virtual Server agent"""

    def __init__(self, agent, name, iid):

        """ Initialize the Instance object for the given Virtual Server instance

            Args:
                agent               (object)    --  the instance of the agent class

                name                (str)       --  the name of the instance

                iid                 (int)       --  the instance id

        """
	self._vendor_id = 403
        self._subscriptionid = None
github CommvaultEngg / cvpysdk / cvpysdk / instances / virtualserver / azureRMinstance.py View on Github external
def __init__(self, agent, name, iid):
        """Initialize the Instance object for the given Virtual Server instance.

            Args:
                class_object (agent_object,instance_name,instance_id)  --  instance of the
                                                                                Agent class,
                                                                                instance name,
                                                                                instance id

        """

        self._vendor_id = 7
        super(VirtualServerInstance, self).__init__(agent, name, iid)
github CommvaultEngg / cvpysdk / cvpysdk / instances / virtualserver / oraclevminstance.py View on Github external
instance_id)                    --  initialize object of oraclevm Instance object
                                                associated with the VirtualServer Instance


    _get_instance_properties()          --  VirtualServer Instance class method overwritten
                                                to get oraclevm specific instance properties

    _get_instance_properties_json()     --  get the all instance(oraclevm)
                                                related properties of this subclient

"""


from ..vsinstance import VirtualServerInstance

class OracleVMInstance(VirtualServerInstance):

    """Class for representing VMWare instance of the Virtual Server agent."""

    def __init__(self, agent_object, instance_name, instance_id=None):
        """Initialize the Instance object for the given Virtual Server instance.

            Args:
                agent_object    (object)    --  instance of the Agent class

                instance_name   (str)       --  instance name

                instance_id     (int)       --  instance id

        """
        self._vendor_id = 10
        self._vmwarvendor = None
github CommvaultEngg / cvpysdk / cvpysdk / instances / virtualserver / vcloud_director.py View on Github external
associated with the VirtualServer Instance


    _get_instance_properties()          --  VirtualServer Instance class method overwritten
                                                to get vcloud specific instance properties

    _get_instance_properties_json()     --  get the all instance(vcloud)
                                                related properties of this subclient

"""

from ..vsinstance import VirtualServerInstance
from ...instance import Instance


class vcloudInstance(VirtualServerInstance):
    """Class for representing VCloud instance of the Virtual Server agent."""

    def __init__(self, agent_object, instance_name, instance_id=None):
        """Initialize the Instance object for the given Virtual Server instance.

            Args:
                agent_object    (object)    --  instance of the Agent class

                instance_name   (str)       --  instance name

                instance_id     (int)       --  instance id

        """
        self._vendor_id = 103
        self._vmwarvendor = None
        self._server_name = []
github CommvaultEngg / cvpysdk / cvpysdk / instances / virtualserver / azureRMinstance.py View on Github external
VirtualServer Instance		

    _get_instance_properties()     --  VirtualServer Instance class method
                                        overwritten to get azure RM
                                        Specific instance properties as well

	_get_instance_properties_json()			--  get the all instance related
														properties of this subclient.

"""

from ..vsinstance import VirtualServerInstance
from ...exception import SDKException
from ...instance import Instance

class AzureRMInstance(VirtualServerInstance):

    '''
    AzureResoureceManagerInstance:

	__init__(agent_object,instance_name,instance_id)    --  initialize object
    of azure resource manager Instance object associated with
		the VirtualServer Instance
    '''

    def __init__(self, agent, name, iid):
        """Initialize the Instance object for the given Virtual Server instance.

            Args:
                class_object (agent_object,instance_name,instance_id)  --  instance of the
                                                                                Agent class,
                                                                                instance name,
github CommvaultEngg / cvpysdk / cvpysdk / instances / virtualserver / googlecloudinstance.py View on Github external
GoogleCloudInstance: Derived class from VirtualServer  Base class, representing a
                    Google Cloud Platform instance, and to perform operations on that instance

GoogleCloudInstance:
    __init__(agent_object,instance_name,instance_id)    --  initialize object of Google Cloud
                                                            Platform Instance object associated
                                                            with the VirtualServer Instance

"""

from ..vsinstance import VirtualServerInstance
from ...exception import SDKException
from ...instance import Instance


class GoogleCloudInstance(VirtualServerInstance):
    def __init__(self, agent, name, iid):
        self._vendor_id = 16
        self._server_name = []
        super(GoogleCloudInstance, self).__init__(agent, name, iid)

    def _get_instance_properties(self):
        """
        Get the properties of this instance

        Raise:
            SDK Exception:
                if response is not empty
                if response is not success
        """

        super(GoogleCloudInstance, self)._get_instance_properties()
github CommvaultEngg / cvpysdk / cvpysdk / instances / virtualserver / openstack.py View on Github external
instance_id)                    --  initialize object of vmware Instance object
                                                associated with the VirtualServer Instance


    _get_instance_properties()          --  VirtualServer Instance class method overwritten
                                                to get openstack specific instance properties

    _get_instance_properties_json()     --  get the all instance(vmware)
                                                related properties of this subclient

"""

from ..vsinstance import VirtualServerInstance


class OpenStackInstance(VirtualServerInstance):
    """Class for representing VMWare instance of the Virtual Server agent."""

    def __init__(self, agent_object, instance_name, instance_id=None):
        """Initialize the Instance object for the given Virtual Server instance.

            Args:
                agent_object    (object)    --  instance of the Agent class

                instance_name   (str)       --  instance name

                instance_id     (int)       --  instance id

        """
        self._vendor_id = 12
        self._server_name = []
        self._server_host_name = []
github CommvaultEngg / cvpysdk / cvpysdk / instances / virtualserver / nutanixinstance.py View on Github external
VirtualServer Instance

    _get_instance_properties()           --  VirtualServer Instance class method
                                             overwritten to get nutanix AHV
                                            Specific instance properties as well

	_get_instance_properties_json()		 --  get the all instance related
											 properties of this subclient.

"""

from ..vsinstance import VirtualServerInstance
from ...exception import SDKException
from ...instance import Instance

class nutanixinstance(VirtualServerInstance):

    """Class for representing Nutanix AHV instance of the Virtual Server agent"""

    def __init__(self, agent, name, iid):
        """ Initialize the Instance object for the given Virtual Server instance

            Args:
                agent               (object)    --  the instance of the agent class

                name                (str)       --  the name of the instance

                iid                 (int)       --  the instance id

        """
	self._vendor_id = 601
        self._nutanix_cluster = None
github CommvaultEngg / cvpysdk / cvpysdk / instances / virtualserver / hypervinstance.py View on Github external
_get_instance_properties()                          --  VirtualServer Instance class method
                                                            overwritten to get Hyper-V Specific
                                                                         instance properties as well

    _set_instance_properties()                          --  Hyper-V Instance class method  to
                                                        set Hyper-V Specific instance properties


"""


from ..vsinstance import VirtualServerInstance

class HyperVInstance(VirtualServerInstance):
    """Class for representing an Hyper-V of the Virtual Server agent."""

    def __init__(self, agent, instance_name, instance_id=None):
        """Initialize the Instance object for the given Virtual Server instance.

            Args:
                class_object (agent_object,instance_name,instance_id)  --  instance of the
                                                                                Agent class,
                                                                                instance name,
                                                                                instance id

        """
        self._vendor_id = 2
        super(HyperVInstance, self).__init__(agent, instance_name, instance_id)