Esempio n. 1
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)
Esempio n. 2
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)
Esempio n. 3
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)
Esempio n. 4
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)
Esempio n. 5
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)