ndio/remote/metadata.py
def set_metadata(self, token, data):
        """
        Insert new metadata into the OCP metadata database.

        Arguments:
            token (str): Token of the datum to set
            data (str): A dictionary to insert as metadata. Include `secret`.

        Returns:
            json: Info of the inserted ID (convenience) or an error message.

        Throws:
            RemoteDataUploadError: If the token is already populated, or if
                there is an issue with your specified `secret` key.
        """
        req = requests.post(self.meta_url("metadata/ocp/set/" + token),
                            json=data, verify=False)

        if req.status_code != 200:
            raise RemoteDataUploadError(
                "Could not upload metadata: " + req.json()['message']
            )
        return req.json()
def set_metadata(self, token, data):
        req = requests.post(self.meta_url("metadata/ocp/set/" + token),
                            json=data, verify=False)

        if req.status_code != 200:
            raise RemoteDataUploadError(
                "Could not upload metadata: " + req.json()['message']
            )
        return req.json()
def set_metadata ( self , token , data ) : req = requests . post ( self . meta_url ( "metadata/ocp/set/" + token ) , json = data , verify = False ) if req . status_code != 200 : raise RemoteDataUploadError ( "Could not upload metadata: " + req . json ( ) [ 'message' ] ) return req . json ( )
Insert new metadata into the OCP metadata database.

        Arguments:
            token (str): Token of the datum to set
            data (str): A dictionary to insert as metadata. Include `secret`.

        Returns:
            json: Info of the inserted ID (convenience) or an error message.

        Throws:
            RemoteDataUploadError: If the token is already populated, or if
                there is an issue with your specified `secret` key.
Insert new metadata into the OCP metadata database .