labpack/authentication/aws/iam.py
def read_certificate(self, certificate_name):

        '''
            a method to retrieve the details about a server certificate

        :param certificate_name: string with name of server certificate
        :return: dictionary with certificate details
        '''

        title = '%s.read_certificate' % self.__class__.__name__

    # validate inputs
        input_fields = {
            'certificate_name': certificate_name
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)

    # verify existence of server certificate
        if not certificate_name in self.certificate_list:
            self.printer_on = False
            self.list_certificates()
            self.printer_on = True
            if not certificate_name in self.certificate_list:
                raise Exception('\nServer certificate %s does not exist.' % certificate_name)

    # send request for certificate details
        try:
            cert_kwargs = { 'ServerCertificateName': certificate_name }
            response = self.connection.get_server_certificate(**cert_kwargs)
        except:
            raise AWSConnectionError(title)

    # construct certificate details from response
        from labpack.records.time import labDT
        from labpack.parsing.conversion import camelcase_to_lowercase
        cert_dict = response['ServerCertificate']
        cert_details = camelcase_to_lowercase(cert_dict)
        for key, value in cert_details['server_certificate_metadata'].item():
            cert_details.update(**{key:value})
        del cert_details['server_certificate_metadata']
        date_time = cert_details['expiration']
        epoch_time = labDT(date_time).epoch()
        cert_details['expiration'] = epoch_time

        return cert_details

            a method to retrieve the details about a server certificate

        :param certificate_name: string with name of server certificate
        :return: dictionary with certificate details
        
a method to retrieve the details about a server certificate
a method to retrieve the details about a server certificate
def read_certificate(self, certificate_name):
        title = '%s.read_certificate' % self.__class__.__name__
        input_fields = {
            'certificate_name': certificate_name
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)
        if not certificate_name in self.certificate_list:
            self.printer_on = False
            self.list_certificates()
            self.printer_on = True
            if not certificate_name in self.certificate_list:
                raise Exception('\nServer certificate %s does not exist.' % certificate_name)
        try:
            cert_kwargs = { 'ServerCertificateName': certificate_name }
            response = self.connection.get_server_certificate(**cert_kwargs)
        except:
            raise AWSConnectionError(title)
        from labpack.records.time import labDT
        from labpack.parsing.conversion import camelcase_to_lowercase
        cert_dict = response['ServerCertificate']
        cert_details = camelcase_to_lowercase(cert_dict)
        for key, value in cert_details['server_certificate_metadata'].item():
            cert_details.update(**{key:value})
        del cert_details['server_certificate_metadata']
        date_time = cert_details['expiration']
        epoch_time = labDT(date_time).epoch()
        cert_details['expiration'] = epoch_time
        return cert_details
def read_certificate ( self , certificate_name ) : title = '%s.read_certificate' % self . __class__ . __name__ input_fields = { 'certificate_name' : certificate_name } for key , value in input_fields . items ( ) : object_title = '%s(%s=%s)' % ( title , key , str ( value ) ) self . fields . validate ( value , '.%s' % key , object_title ) if not certificate_name in self . certificate_list : self . printer_on = False self . list_certificates ( ) self . printer_on = True if not certificate_name in self . certificate_list : raise Exception ( '\nServer certificate %s does not exist.' % certificate_name ) try : cert_kwargs = { 'ServerCertificateName' : certificate_name } response = self . connection . get_server_certificate ( ** cert_kwargs ) except : raise AWSConnectionError ( title ) from labpack . records . time import labDT from labpack . parsing . conversion import camelcase_to_lowercase cert_dict = response [ 'ServerCertificate' ] cert_details = camelcase_to_lowercase ( cert_dict ) for key , value in cert_details [ 'server_certificate_metadata' ] . item ( ) : cert_details . update ( ** { key : value } ) del cert_details [ 'server_certificate_metadata' ] date_time = cert_details [ 'expiration' ] epoch_time = labDT ( date_time ) . epoch ( ) cert_details [ 'expiration' ] = epoch_time return cert_details
a method to retrieve the details about a server certificate
a method to retrieve the details about a server certificate
'''
            a method to retrieve the details about a server certificate

        :param certificate_name: string with name of server certificate
        :return: dictionary with certificate details
        ''' # validate inputs # verify existence of server certificate # send request for certificate details # construct certificate details from response
dictionary with certificate details
dictionary with certificate details
self
certificate_name
string with name of server certificate
string with name of server certificate