def create(self, definition, scope='private'):
        self._ensure_not_empty(definition=definition)

        # If the specified definition is actually a file, read in the
        # definition file
        definition = utils.get_contents_if_file(definition)

        resp = self.client.http_client.post(
            '/actions?scope=%s' % scope,
            definition,
            headers={'content-type': 'text/plain'}
        )

        if resp.status_code != 201:
            self._raise_api_exception(resp)

        return [self.resource_class(self, resource_data)
                for resource_data in base.extract_json(resp, 'actions')]
dataset/ETHPy150Open openstack/python-mistralclient/mistralclient/api/v2/actions.py/ActionManager.create/original