How to use the cvpysdk.security.security_association.SecurityAssociation.fetch_security_association 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 / security / usergroup.py View on Github external
if flag:
            if response.json() and 'userGroups' in response.json():
                self._properties = response.json()['userGroups'][0]

                if 'description' in self._properties:
                    self._description = self._properties['description']

                if 'enabled' in self._properties:
                    self._usergroup_status = self._properties['enabled']

                if 'email' in self._properties:
                    self._email = self._properties['email']

                security_properties = self._properties.get('securityAssociations', {}).get(
                    'associations', {})
                self._security_associations = SecurityAssociation.fetch_security_association(
                    security_dict=security_properties)
            else:
                raise SDKException('Response', '102')
        else:
            response_string = self._commcell_object._update_response_(response.text)
            raise SDKException('Response', '101', response_string)
github CommvaultEngg / cvpysdk / cvpysdk / security / user.py View on Github external
def _get_user_properties(self):
        """Gets the properties of this user"""
        flag, response = self._commcell_object._cvpysdk_object.make_request(
            'GET', self._user
        )

        if flag:
            if response.json() and 'users' in response.json():
                self._properties = response.json()['users'][0]
                self._security_properties = self._properties.get('securityAssociations', {}).get(
                    'associations', {})
                self._security_associations = SecurityAssociation.fetch_security_association(
                    security_dict=self._security_properties)
                if 'enableUser' in self._properties:
                    self._user_status = self._properties['enableUser']

                if 'email' in self._properties:
                    self._email = self._properties['email']

                if 'description' in self._properties:
                    self._description = self._properties['description']

                if 'associatedUserGroups' in self._properties:
                    self._associated_usergroups = self._properties['associatedUserGroups']
            else:
                raise SDKException('Response', '102')
        else:
            response_string = self._commcell_object._update_response_(response.text)