Browse Source

Add function_alias to execution, webhook and job

executions, webhooks and jobs endpoints are able to
take function_alias as a parameter.

An alias point to a function and a specific version of
this one.

Change-Id: I2e28a4e08fa80109767c28f77da7887a8603f2ec
changes/64/666164/2
Gaëtan Trellu 1 year ago
parent
commit
982c45c978
8 changed files with 133 additions and 48 deletions
  1. +14
    -10
      api-ref/source/executions.inc
  2. +12
    -8
      api-ref/source/jobs.inc
  3. +65
    -20
      api-ref/source/parameters.yaml
  4. +6
    -0
      api-ref/source/samples/executions/create-execution-alias-request.json
  5. +7
    -0
      api-ref/source/samples/jobs/create-job-alias-request.json
  6. +4
    -0
      api-ref/source/samples/webhooks/create-webhook-alias-request.json
  7. +4
    -0
      api-ref/source/samples/webhooks/update-webhook-alias-request.json
  8. +21
    -10
      api-ref/source/webhooks.inc

+ 14
- 10
api-ref/source/executions.inc View File

@ -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


+ 12
- 8
api-ref/source/jobs.inc View File

@ -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


+ 65
- 20
api-ref/source/parameters.yaml View File

@ -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_url:
webhook_function_alias:
description: |
Webhook URL
Alias name of the function (if an alias has been created)
in: body
required: true
required: false
type: string
webhook_version:
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

+ 6
- 0
api-ref/source/samples/executions/create-execution-alias-request.json View File

@ -0,0 +1,6 @@
{
"description": "Execution of a function based on an alias",
"sync": true,
"input": "{\"name\": \"foo\"}",
"function_alias": "hq-production-function"
}

+ 7
- 0
api-ref/source/samples/jobs/create-job-alias-request.json View File

@ -0,0 +1,7 @@
{
"count": 5,
"name": "every-minute",
"pattern": "* * * * *",
"function_input": "{\"name\": \"Foo\"}",
"function_alias": "hq-production-function"
}

+ 4
- 0
api-ref/source/samples/webhooks/create-webhook-alias-request.json View File

@ -0,0 +1,4 @@
{
"function_alias": "hq-production-function",
"description": "Webhook based on function alias triggered by Jenkins"
}

+ 4
- 0
api-ref/source/samples/webhooks/update-webhook-alias-request.json View File

@ -0,0 +1,4 @@
{
"description": "Webhook based on function alias triggered by Gitlab",
"function_alias": "hq-staging-function"
}

+ 21
- 10
api-ref/source/webhooks.inc View File

@ -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
----------------


Loading…
Cancel
Save