diff --git a/api-ref/source/executions.inc b/api-ref/source/executions.inc index f2c883b8..155b105e 100644 --- a/api-ref/source/executions.inc +++ b/api-ref/source/executions.inc @@ -36,10 +36,11 @@ Request .. rest_parameters:: parameters.yaml - x-auth-token: x-auth-token - - function_id: function_id + - function_id: execution_function_id + - function_alias: execution_function_alias - input: execution_input - description: execution_description - - function_version: execution_version + - function_version: execution_function_version - sync: execution_sync Request Example @@ -48,16 +49,19 @@ Request Example .. literalinclude:: samples/executions/create-execution-request.json :language: javascript +.. literalinclude:: samples/executions/create-execution-alias-request.json + :language: javascript + Response Parameters ------------------- .. rest_parameters:: parameters.yaml - id: id - - function_id: function_id + - function_id: execution_function_id - input: execution_input - description: execution_description - - function_version: execution_version + - function_version: execution_function_version - sync: execution_sync - project_id: project_id - status: status @@ -104,10 +108,10 @@ Response Parameters .. rest_parameters:: parameters.yaml - id: id - - function_id: function_id + - function_id: execution_function_id - input: execution_input - description: execution_description - - function_version: execution_version + - function_version: execution_function_version - sync: execution_sync - project_id: project_id - status: status @@ -156,10 +160,10 @@ Response Parameters .. rest_parameters:: parameters.yaml - id: id - - function_id: function_id + - function_id: execution_function_id - input: execution_input - description: execution_description - - function_version: execution_version + - function_version: execution_function_version - sync: execution_sync - project_id: project_id - status: status @@ -207,10 +211,10 @@ Response Parameters .. rest_parameters:: parameters.yaml - id: id - - function_id: function_id + - function_id: execution_function_id - input: execution_input - description: execution_description - - function_version: execution_version + - function_version: execution_function_version - sync: execution_sync - project_id: project_id - status: status diff --git a/api-ref/source/jobs.inc b/api-ref/source/jobs.inc index fa322a9c..ba449b47 100644 --- a/api-ref/source/jobs.inc +++ b/api-ref/source/jobs.inc @@ -37,8 +37,9 @@ Request - x-auth-token: x-auth-token - name: job_name - - function_id: function_id - - function_version: job_version + - function_id: job_function_id + - function_alias: job_function_alias + - function_version: job_function_version - function_input: job_input - pattern: job_pattern - count: job_count @@ -49,6 +50,9 @@ Request Example .. literalinclude:: samples/jobs/create-job-request.json :language: javascript +.. literalinclude:: samples/jobs/create-job-alias-request.json + :language: javascript + Response Parameters ------------------- @@ -56,8 +60,8 @@ Response Parameters - id: id - name: job_name - - function_id: function_id - - function_version: job_version + - function_id: job_function_id + - function_version: job_function_version - function_input: job_input - pattern: job_pattern - count: job_count @@ -109,8 +113,8 @@ Response Parameters - id: id - name: job_name - - function_id: function_id - - function_version: job_version + - function_id: job_function_id + - function_version: job_function_version - function_input: job_input - pattern: job_pattern - count: job_count @@ -163,8 +167,8 @@ Response Parameters - id: id - name: job_name - - function_id: function_id - - function_version: job_version + - function_id: job_function_id + - function_version: job_function_version - function_input: job_input - pattern: job_pattern - count: job_count diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml index efddd5a1..66acd901 100644 --- a/api-ref/source/parameters.yaml +++ b/api-ref/source/parameters.yaml @@ -108,6 +108,29 @@ execution_description: required: false type: string +execution_function_alias: + description: | + Alias name of the function (if an alias has been created) + in: body + required: false + type: string + +execution_function_id: + description: | + ID for the function, if an alias is used then ``function_id`` is + not required + in: body + required: true + type: uuid + +execution_function_version: + description: | + Version of the function to execute, default is ``0``. If an alias is + used then ``function_version`` is not required + in: body + required: false + type: integer + execution_input: description: | Input data to pass to the function, e.g. ``{"name": "foo"}`` @@ -122,13 +145,6 @@ execution_sync: required: false type: bool -execution_version: - description: | - Version of the function to execute, default is ``0`` - in: body - required: false - type: integer - function_code: description: | Source code type, e.g. "``package``", "``swift``", "``image``" @@ -282,6 +298,29 @@ job_first_execution: required: true type: string +job_function_alias: + description: | + Alias name of the function (if an alias has been created) + in: body + required: false + type: string + +job_function_id: + description: | + ID for the function, if an alias is used then ``function_id`` is + not required + in: body + required: true + type: uuid + +job_function_version: + description: | + Version of the function to execute, default is ``0``. If an alias is + used then ``function_version`` is not required + in: body + required: false + type: integer + job_input: description: | Input data to pass to the function, e.g. ``{"name": "foo"}`` @@ -331,15 +370,6 @@ job_status_update: required: false type: string -job_version: - description: | - Version of the function to execute, default is ``0`` - in: body - required: false - type: integer - - - project_id: description: | ID for the project that owns the resource @@ -457,16 +487,31 @@ webhook_description: required: false type: string +webhook_function_alias: + description: | + Alias name of the function (if an alias has been created) + in: body + required: false + type: string + +webhook_function_id: + description: | + ID for the function, if an alias is used then ``function_id`` is + not required + in: body + required: true + type: uuid + +webhook_function_version: + description: | + Version of the function + in: body + required: false + type: integer + webhook_url: description: | Webhook URL in: body required: true type: string - -webhook_version: - description: | - Version of the function - in: body - required: false - type: integer diff --git a/api-ref/source/samples/executions/create-execution-alias-request.json b/api-ref/source/samples/executions/create-execution-alias-request.json new file mode 100644 index 00000000..f0d6bc4f --- /dev/null +++ b/api-ref/source/samples/executions/create-execution-alias-request.json @@ -0,0 +1,6 @@ +{ + "description": "Execution of a function based on an alias", + "sync": true, + "input": "{\"name\": \"foo\"}", + "function_alias": "hq-production-function" +} diff --git a/api-ref/source/samples/jobs/create-job-alias-request.json b/api-ref/source/samples/jobs/create-job-alias-request.json new file mode 100644 index 00000000..6959338b --- /dev/null +++ b/api-ref/source/samples/jobs/create-job-alias-request.json @@ -0,0 +1,7 @@ +{ + "count": 5, + "name": "every-minute", + "pattern": "* * * * *", + "function_input": "{\"name\": \"Foo\"}", + "function_alias": "hq-production-function" +} diff --git a/api-ref/source/samples/webhooks/create-webhook-alias-request.json b/api-ref/source/samples/webhooks/create-webhook-alias-request.json new file mode 100644 index 00000000..0e4dd86d --- /dev/null +++ b/api-ref/source/samples/webhooks/create-webhook-alias-request.json @@ -0,0 +1,4 @@ +{ + "function_alias": "hq-production-function", + "description": "Webhook based on function alias triggered by Jenkins" +} diff --git a/api-ref/source/samples/webhooks/update-webhook-alias-request.json b/api-ref/source/samples/webhooks/update-webhook-alias-request.json new file mode 100644 index 00000000..43db3416 --- /dev/null +++ b/api-ref/source/samples/webhooks/update-webhook-alias-request.json @@ -0,0 +1,4 @@ +{ + "description": "Webhook based on function alias triggered by Gitlab", + "function_alias": "hq-staging-function" +} diff --git a/api-ref/source/webhooks.inc b/api-ref/source/webhooks.inc index 8ddbbb18..0c70df03 100644 --- a/api-ref/source/webhooks.inc +++ b/api-ref/source/webhooks.inc @@ -36,8 +36,9 @@ Request .. rest_parameters:: parameters.yaml - x-auth-token: x-auth-token - - function_id: function_id - - function_version: webhook_version + - function_id: webhook_function_id + - function_alias: webhook_function_alias + - function_version: webhook_function_version - description: webhook_description Request Example @@ -46,6 +47,9 @@ Request Example .. literalinclude:: samples/webhooks/create-webhook-request.json :language: javascript +.. literalinclude:: samples/webhooks/create-webhook-alias-request.json + :language: javascript + Response Parameters ------------------- @@ -53,8 +57,8 @@ Response Parameters - id: id - description: webhook_description - - function_id: function_id - - version_number: webhook_version + - function_id: webhook_function_id + - version_number: webhook_function_version - webhook_url: webhook_url - project_id: project_id - created_at: created_at @@ -102,8 +106,8 @@ Response Parameters - id: id - description: webhook_description - - function_id: function_id - - version_number: webhook_version + - function_id: webhook_function_id + - version_number: webhook_function_version - webhook_url: webhook_url - project_id: project_id - created_at: created_at @@ -152,8 +156,8 @@ Response Parameters - id: id - description: webhook_description - - function_id: function_id - - version_number: webhook_version + - function_id: webhook_function_id + - version_number: webhook_function_version - webhook_url: webhook_url - project_id: project_id - created_at: created_at @@ -193,6 +197,10 @@ Request - x-auth-token: x-auth-token - webhook_id: path_webhook_id + - function_id: webhook_function_id + - function_alias: webhook_function_alias + - function_version: webhook_function_version + - description: webhook_description Response Parameters ------------------- @@ -201,8 +209,8 @@ Response Parameters - id: id - description: webhook_description - - function_id: function_id - - version_number: webhook_version + - function_id: webhook_function_id + - version_number: webhook_function_version - webhook_url: webhook_url - project_id: project_id - created_at: created_at @@ -214,6 +222,9 @@ Request Example .. literalinclude:: samples/webhooks/update-webhook-request.json :language: javascript +.. literalinclude:: samples/webhooks/update-webhook-alias-request.json + :language: javascript + Response Example ----------------