Ejemplo n.º 1
0
    def get_access_settings(self):
        """Get the access settings of the vdc.

       :return:  A :class:`lxml.objectify.StringElement` object representing
           the access settings of the vdc.
       """
        acl = Acl(self.client, self.get_resource())
        return acl.get_access_settings()
Ejemplo n.º 2
0
    def get_access_settings(self):
        """Get the access settings of the vapp.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the access settings of the vapp.
        """
        acl = Acl(self.client, self.get_resource())
        return acl.get_access_settings()
Ejemplo n.º 3
0
    def unshare_from_org_members(self):
        """Unshare the vapp from all members of current organization.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the vapp.
        """
        acl = Acl(self.client, self.get_resource())
        return acl.unshare_from_org_members()
Ejemplo n.º 4
0
    def unshare_from_org_members(self):
        """Unshare the vapp from all members of current organization.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the vapp.
        """
        acl = Acl(self.client, self.get_resource())
        return acl.unshare_from_org_members()
Ejemplo n.º 5
0
    def get_access_settings(self):
        """Get the access settings of the vApp.

        :return: an object containing EntityType.CONTROL_ACCESS_PARAMS which
            represents the access control list of the vApp.

        :rtype: lxml.objectify.ObjectifiedElement
        """
        acl = Acl(self.client, self.get_resource())
        return acl.get_access_settings()
Ejemplo n.º 6
0
    def unshare_from_org_members(self):
        """Unshare the vApp from all members of current organization.

        :return: an object containing EntityType.CONTROL_ACCESS_PARAMS XML
            data representing the updated access control setting of the vdc.

        :rtype: lxml.objectify.ObjectifiedElement
        """
        acl = Acl(self.client, self.get_resource())
        return acl.unshare_from_org_members()
Ejemplo n.º 7
0
    def get_catalog_access_settings(self, catalog_name):
        """Get the access settings of a catalog.

        :param catalog_name: (str): The name of the catalog.
        :return:  A :class:`lxml.objectify.StringElement` object representing
            the access settings of the catalog.
        """
        catalog_resource = self.get_catalog(name=catalog_name)
        acl = Acl(self.client, catalog_resource)
        return acl.get_access_settings()
Ejemplo n.º 8
0
    def get_catalog_access_settings(self, catalog_name):
        """Get the access settings of a catalog.

        :param catalog_name: (str): The name of the catalog.
        :return:  A :class:`lxml.objectify.StringElement` object representing
            the access settings of the catalog.
        """
        catalog_resource = self.get_catalog(name=catalog_name)
        acl = Acl(self.client, catalog_resource)
        return acl.get_access_settings()
Ejemplo n.º 9
0
    def unshare_from_org_members(self):
        """Unshare the vdc from all members of current organization.

        Should give individual access to at least one user before unsharing
        access to the whole org.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the vdc.
        """
        acl = Acl(self.client, self.get_resource())
        return acl.unshare_from_org_members()
Ejemplo n.º 10
0
    def share_with_org_members(self, everyone_access_level='ReadOnly'):
        """Share the vdc to all members of the organization.

        :param everyone_access_level: (str) : access level when sharing the
            vdc with everyone. Only 'ReadOnly' is allowed for vdc.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the vdc.
        """
        acl = Acl(self.client, self.get_resource())
        return acl.share_with_org_members(everyone_access_level)
Ejemplo n.º 11
0
    def unshare_from_org_members(self):
        """Unshare the vdc from all members of current organization.

        Should give individual access to at least one user before unsharing
        access to the whole org.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the vdc.
        """
        acl = Acl(self.client, self.get_resource())
        return acl.unshare_from_org_members()
Ejemplo n.º 12
0
    def share_with_org_members(self, everyone_access_level='ReadOnly'):
        """Share the vdc to all members of the organization.

        :param everyone_access_level: (str) : access level when sharing the
            vdc with everyone. Only 'ReadOnly' is allowed for vdc.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the vdc.
        """
        acl = Acl(self.client, self.get_resource())
        return acl.share_with_org_members(everyone_access_level)
Ejemplo n.º 13
0
    def unshare_catalog_with_org_members(self, catalog_name):
        """Unshare the catalog from all members of current organization.

        :param catalog_name: (str): catalog name whose access should be
            unshared from everyone.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the catalog.
        """
        catalog_resource = self.get_catalog(name=catalog_name)
        acl = Acl(self.client, catalog_resource)
        return acl.unshare_from_org_members()
Ejemplo n.º 14
0
    def unshare_catalog_with_org_members(self, catalog_name):
        """Unshare the catalog from all members of current organization.

        :param catalog_name: (str): catalog name whose access should be
            unshared from everyone.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the catalog.
        """
        catalog_resource = self.get_catalog(name=catalog_name)
        acl = Acl(self.client, catalog_resource)
        return acl.unshare_from_org_members()
Ejemplo n.º 15
0
    def share_with_org_members(self, everyone_access_level='ReadOnly'):
        """Share the vapp to all members of the organization.

        :param everyone_access_level: (str) : access level when sharing the
            vapp with everyone. One of 'ReadOnly', 'Change', 'FullControl'.
            'ReadOnly' by default.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the vapp.
        """
        acl = Acl(self.client, self.get_resource())
        return acl.share_with_org_members(everyone_access_level)
Ejemplo n.º 16
0
    def share_with_org_members(self, everyone_access_level='ReadOnly'):
        """Share the vapp to all members of the organization.

        :param everyone_access_level: (str) : access level when sharing the
            vapp with everyone. One of 'ReadOnly', 'Change', 'FullControl'.
            'ReadOnly' by default.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the vapp.
        """
        acl = Acl(self.client, self.get_resource())
        return acl.share_with_org_members(everyone_access_level)
Ejemplo n.º 17
0
    def share_with_org_members(self, everyone_access_level='ReadOnly'):
        """Share the vApp to all members of the organization.

        :param everyone_access_level: (str) : access level when sharing the
            vApp with everyone. Allowed values are 'ReadOnly', 'Change', or
            'FullControl'. Default value is 'ReadOnly'.

        :return: an object containing EntityType.CONTROL_ACCESS_PARAMS XML
            data representing the updated access control setting of the vdc.

        :rtype: lxml.objectify.ObjectifiedElement
        """
        acl = Acl(self.client, self.get_resource())
        return acl.share_with_org_members(everyone_access_level)
Ejemplo n.º 18
0
    def add_access_settings(self, access_settings_list=None):
        """Add access settings to a particular vapp.

        :param access_settings_list: (list of dict): list of access_setting
            in the dict format. Each dict contains:
            - type: (str): type of the subject. Only 'user' allowed for vapp.
            - name: (str): name of the user.
            - access_level: (str): access_level of the particular subject. One
                of 'ReadOnly', 'Change', 'FullControl'

        :return:  A :class:`lxml.objectify.StringElement` object representing
        the updated access control setting of the vapp.
        """
        acl = Acl(self.client, self.get_resource())
        return acl.add_access_settings(access_settings_list)
Ejemplo n.º 19
0
    def add_access_settings(self, access_settings_list=None):
        """Add access settings to a particular vdc.

        :param access_settings_list: (list of dict): list of access_setting
            in the dict format. Each dict contains:
            type: (str): type of the subject. 'Only 'user' allowed for vdc.
            name: (str): name of the user.
            access_level: (str): access_level of the particular subject.
            Only 'ReadOnly' is allowed for vdc.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the vdc.
        """
        acl = Acl(self.client, self.get_resource())
        return acl.add_access_settings(access_settings_list)
Ejemplo n.º 20
0
    def share_catalog_access(self, catalog_name,
                             everyone_access_level='ReadOnly'):
        """Share the catalog to all members of the organization.

        :param catalog_name: (str): catalog name whose access should be
            shared to everyone.
        :param everyone_access_level: (str) : access level when sharing the
            catalog with everyone. One of 'ReadOnly', 'Change', 'FullControl'
            'ReadOnly' by default.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the catalog.
        """
        catalog_resource = self.get_catalog(name=catalog_name)
        acl = Acl(self.client, catalog_resource)
        return acl.share_access(everyone_access_level)
Ejemplo n.º 21
0
    def remove_access_settings(self,
                               access_settings_list=None,
                               remove_all=False):
        """Remove access settings from a particular vapp.

        :param access_settings_list: (list of dict): list of access_setting
            in the dict format. Each dict contains:
            - type: (str): type of the subject. Only 'user' allowed for vapp.
            - name: (str): name of the user.
        :param remove_all: (bool) : True if all access settings of the vapp
            should be removed

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the vapp.
        """
        acl = Acl(self.client, self.get_resource())
        return acl.remove_access_settings(access_settings_list, remove_all)
Ejemplo n.º 22
0
    def share_catalog_with_org_members(self,
                                       catalog_name,
                                       everyone_access_level='ReadOnly'):
        """Share the catalog to all members of the organization.

        :param catalog_name: (str): catalog name whose access should be
            shared to everyone.
        :param everyone_access_level: (str) : access level when sharing the
            catalog with everyone. One of 'ReadOnly', 'Change', 'FullControl'
            'ReadOnly' by default.

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the catalog.
        """
        catalog_resource = self.get_catalog(name=catalog_name)
        acl = Acl(self.client, catalog_resource)
        return acl.share_with_org_members(everyone_access_level)
Ejemplo n.º 23
0
    def remove_access_settings(self,
                               access_settings_list=None,
                               remove_all=False):
        """Remove access settings from a particular vdc.

        :param access_settings_list: (list of dict): list of access_setting
            in the dict format. Each dict contains:
            type: (str): type of the subject. Only 'user' allowed for vdc.
            name: (str): name of the user.
        :param remove_all: (bool) : True if all access settings of the vdc
            should be removed

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the vdc.
        """
        acl = Acl(self.client, self.get_resource())
        return acl.remove_access_settings(access_settings_list, remove_all)
Ejemplo n.º 24
0
    def add_catalog_access_settings(self, catalog_name,
                                    access_settings_list=None):
        """Add access settings to a particular catalog.

        :param catalog_name: (str): name of the catalog for which acl needs
            to be added.
        :param access_settings_list: (list of dict): list of access_setting
            in the dict format. Each dict contains:
            type: (str): type of the subject. One of 'org' or 'user'.
            name: (str): name of the user or org.
            access_level: (str): access_level of the particular subject. One of
            'ReadOnly', 'Change', 'FullControl'

        :return:  A :class:`lxml.objectify.StringElement` object representing
        the updated access control setting of the catalog.
        """
        catalog_resource = self.get_catalog(name=catalog_name)
        acl = Acl(self.client, catalog_resource)
        return acl.add_access_settings(access_settings_list)
Ejemplo n.º 25
0
    def add_access_settings(self, access_settings_list=None):
        """Add access settings to the vApp.

        :param list access_settings_list: list of dictionaries, where each
            dictionary represents a single access setting. The dictionary
            structure is as follows,

            - type: (str): type of the subject. One of 'org' or 'user'.
            - name: (str): name of the user or org.
            - access_level: (str): access_level of the particular subject.
                Allowed values are 'ReadOnly', 'Change' or 'FullControl'.

        :return: an object containing EntityType.CONTROL_ACCESS_PARAMS XML
            data representing the updated Access Control List of the vApp.

        :rtype: lxml.objectify.ObjectifiedElement
        """
        acl = Acl(self.client, self.get_resource())
        return acl.add_access_settings(access_settings_list)
Ejemplo n.º 26
0
    def add_catalog_access_settings(self,
                                    catalog_name,
                                    access_settings_list=None):
        """Add access settings to a particular catalog.

        :param catalog_name: (str): name of the catalog for which acl needs
            to be added.
        :param access_settings_list: (list of dict): list of access_setting
            in the dict format. Each dict contains:
            type: (str): type of the subject. One of 'org' or 'user'.
            name: (str): name of the user or org.
            access_level: (str): access_level of the particular subject. One of
            'ReadOnly', 'Change', 'FullControl'

        :return:  A :class:`lxml.objectify.StringElement` object representing
        the updated access control setting of the catalog.
        """
        catalog_resource = self.get_catalog(name=catalog_name)
        acl = Acl(self.client, catalog_resource)
        return acl.add_access_settings(access_settings_list)
Ejemplo n.º 27
0
    def remove_catalog_access_settings(self, catalog_name,
                                       access_settings_list=None,
                                       remove_all=False):
        """Remove access settings from a particular catalog.

        :param catalog_name: (name): catalog name from which access_settings
            should be removed.
        :param access_settings_list: (list of dict): list of access_setting
            in the dict format. Each dict contains:
            type: (str): type of the subject. One of 'org' or 'user'.
            name: (str): name of the user or org.
        :param remove_all: (bool) : True if all access settings of the catalog
            should be removed

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the catalog.
        """
        catalog_resource = self.get_catalog(name=catalog_name)
        acl = Acl(self.client, catalog_resource)
        return acl.remove_access_settings(access_settings_list, remove_all)
Ejemplo n.º 28
0
    def remove_catalog_access_settings(self,
                                       catalog_name,
                                       access_settings_list=None,
                                       remove_all=False):
        """Remove access settings from a particular catalog.

        :param catalog_name: (name): catalog name from which access_settings
            should be removed.
        :param access_settings_list: (list of dict): list of access_setting
            in the dict format. Each dict contains:
            type: (str): type of the subject. One of 'org' or 'user'.
            name: (str): name of the user or org.
        :param remove_all: (bool) : True if all access settings of the catalog
            should be removed

        :return:  A :class:`lxml.objectify.StringElement` object representing
            the updated access control setting of the catalog.
        """
        catalog_resource = self.get_catalog(name=catalog_name)
        acl = Acl(self.client, catalog_resource)
        return acl.remove_access_settings(access_settings_list, remove_all)
Ejemplo n.º 29
0
    def remove_access_settings(self,
                               access_settings_list=None,
                               remove_all=False):
        """Remove access settings from the vApp.

        :param list access_settings_list: list of dictionaries, where each
            dictionary represents a single access setting. The dictionary
            structure is as follows,

            - type: (str): type of the subject. One of 'org' or 'user'.
            - name: (str): name of the user or org.
        :param bool remove_all: True, if the entire Access Control List of the
            vApp should be removed, else False.

        :return: an object containing EntityType.CONTROL_ACCESS_PARAMS XML
            data representing the updated access control setting of the vdc.

        :rtype: lxml.objectify.ObjectifiedElement`
        """
        acl = Acl(self.client, self.get_resource())
        return acl.remove_access_settings(access_settings_list, remove_all)