'Sets one or more metadata items for a server.
For a full list of available parameters, please refer to the official
API reference:
https://developer.openstack.org/api-ref/compute/#create-or-replace-metadata-items'

def set_server_metadata(self, server_id, meta, no_metadata_field=False):

    if no_metadata_field:
        post_body = ''
    else:
        post_body = json.dumps({'metadata': meta})
    (resp, body) = self.put(('servers/%s/metadata' % server_id), post_body)
    body = json.loads(body)
    self.validate_response(schema.set_server_metadata, resp, body)
    return rest_client.ResponseBody(resp, body)
