-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(API): Add OTA Release Triggers API [TSI-2485] (#622)
- Loading branch information
Showing
10 changed files
with
883 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
summary: Create a release trigger | ||
description: Create a new recurring release. New releases will be published automatically, based on the cron schedule provided. | ||
Currently, only one release trigger can exist per distribution. | ||
operationId: release_triggers/create | ||
tags: | ||
- Release Triggers | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
- "$ref": "../../parameters.yaml#/distribution_id" | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
title: release/create/parameters | ||
properties: | ||
cron_schedule: | ||
description: Cron schedule for the scheduler. Read more about the format of this field at https://en.wikipedia.org/wiki/Cron | ||
type: string | ||
example: "15 18 * * 1,3" | ||
time_zone: | ||
description: Time zone for the scheduler | ||
type: string | ||
example: "Europe/Berlin" | ||
locale_ids: | ||
description: List of locale ids that will be included in the release. | ||
type: array | ||
items: | ||
type: string | ||
example: | ||
- abcd1234cdef1234abcd1234cdef1234 | ||
- fff565db236400772368235db2c6117e | ||
tags: | ||
description: Only include tagged keys in the release. For a key to be included it must be tagged with all tags provided | ||
type: array | ||
items: | ||
type: string | ||
example: | ||
- android | ||
- feature1 | ||
branch: | ||
description: Branch used for release | ||
type: string | ||
example: my-feature-branch | ||
app_min_version: | ||
description: The created releases will be available only for apps with version greater or equal to this value | ||
type: string | ||
example: "1.0.0" | ||
app_max_version: | ||
description: The created releases will be available only for apps with version less or equal to this value | ||
type: string | ||
example: "2.0.0" | ||
responses: | ||
"201": | ||
description: Created | ||
content: | ||
application/json: | ||
schema: | ||
"$ref": "../../schemas/release_trigger.yaml#/release_trigger" | ||
headers: | ||
X-Rate-Limit-Limit: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit" | ||
X-Rate-Limit-Remaining: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" | ||
X-Rate-Limit-Reset: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset" | ||
"400": | ||
"$ref": "../../responses.yaml#/400" | ||
"404": | ||
"$ref": "../../responses.yaml#/404" | ||
"429": | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/accounts/:account_id/distributions/:distribution_id/release_triggers" \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X POST \ | ||
-d '{"cron_schedule":"15 18 * * 1,3","time_zone":"Europe/Berlin","locale_ids":["abcd1234cdef1234abcd1234cdef1234","fff565db236400772368235db2c6117e"],"tags":["android","feature1"],"branch":"my-feature-branch","app_min_version":"1.0.0","app_max_version":"2.0.0"}' \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase release_triggers create \ | ||
--account_id <account_id> \ | ||
--distribution_id <distribution_id> \ | ||
--data '{"cron_schedule":"15 18 * * 1,3","time_zone":"Europe/Berlin","locale_ids":["abcd1234cdef1234abcd1234cdef1234","fff565db236400772368235db2c6117e"],"tags":["android","feature1"],"branch":"my-feature-branch","app_min_version":"1.0.0","app_max_version":"2.0.0"}' \ | ||
--access_token <token> | ||
x-cli-version: "2.28" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
summary: Delete a single release trigger | ||
description: Delete a single release trigger. | ||
operationId: release_triggers/destroy | ||
tags: | ||
- Release Triggers | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
- "$ref": "../../parameters.yaml#/distribution_id" | ||
- "$ref": "../../parameters.yaml#/id" | ||
responses: | ||
'204': | ||
"$ref": "../../responses.yaml#/204" | ||
'400': | ||
"$ref": "../../responses.yaml#/400" | ||
'404': | ||
"$ref": "../../responses.yaml#/404" | ||
'429': | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/accounts/:account_id/distributions/:distribution_id/release_triggers/:id" \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X DELETE | ||
- lang: CLI v2 | ||
source: |- | ||
phrase release_triggers delete \ | ||
--account_id <account_id> \ | ||
--distribution_id <distribution_id> \ | ||
--id <id> \ | ||
--access_token <token> | ||
x-cli-version: '2.28' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
summary: List release triggers | ||
description: | | ||
List all release triggers for the given distribution.<br> | ||
Note: Currently only one release trigger can exist per distribution. | ||
operationId: release_triggers/list | ||
tags: | ||
- Release Triggers | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
- "$ref": "../../parameters.yaml#/distribution_id" | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
"$ref": "../../schemas/release_trigger.yaml#/release_trigger" | ||
headers: | ||
X-Rate-Limit-Limit: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit" | ||
X-Rate-Limit-Remaining: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" | ||
X-Rate-Limit-Reset: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset" | ||
'400': | ||
"$ref": "../../responses.yaml#/400" | ||
'404': | ||
"$ref": "../../responses.yaml#/404" | ||
'429': | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/accounts/:account_id/distributions/:distribution_id/release_triggers" \ | ||
-u USERNAME_OR_ACCESS_TOKEN | ||
- lang: CLI v2 | ||
source: |- | ||
phrase release_triggers list \ | ||
--account_id <account_id> \ | ||
--distribution_id <distribution_id> \ | ||
--access_token <token> | ||
x-cli-version: '2.28' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
summary: Get a single release trigger | ||
description: Get details of a single release trigger. | ||
operationId: release_triggers/show | ||
tags: | ||
- Release Triggers | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
- "$ref": "../../parameters.yaml#/distribution_id" | ||
- "$ref": "../../parameters.yaml#/id" | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
"$ref": "../../schemas/release_trigger.yaml#/release_trigger" | ||
headers: | ||
X-Rate-Limit-Limit: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit" | ||
X-Rate-Limit-Remaining: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" | ||
X-Rate-Limit-Reset: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset" | ||
'400': | ||
"$ref": "../../responses.yaml#/400" | ||
'404': | ||
"$ref": "../../responses.yaml#/404" | ||
'429': | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/accounts/:account_id/distributions/:distribution_id/release_triggers/:id" \ | ||
-u USERNAME_OR_ACCESS_TOKEN | ||
- lang: CLI v2 | ||
source: |- | ||
phrase release_triggers show \ | ||
--account_id <account_id> \ | ||
--distribution_id <distribution_id> \ | ||
--id <id> \ | ||
--access_token <token> | ||
x-cli-version: '2.28' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
--- | ||
summary: Update a release trigger | ||
description: Update a recurring release. | ||
operationId: release_triggers/update | ||
tags: | ||
- Release Triggers | ||
parameters: | ||
- "$ref": "../../parameters.yaml#/X-PhraseApp-OTP" | ||
- "$ref": "../../parameters.yaml#/account_id" | ||
- "$ref": "../../parameters.yaml#/distribution_id" | ||
- "$ref": "../../parameters.yaml#/id" | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
title: release/update/parameters | ||
properties: | ||
cron_schedule: | ||
description: Cron schedule for the scheduler. Read more about the format of this field at https://en.wikipedia.org/wiki/Cron | ||
type: string | ||
example: "15 18 * * 1,3" | ||
time_zone: | ||
description: Time zone for the scheduler | ||
type: string | ||
example: "Europe/Berlin" | ||
locale_ids: | ||
description: List of locale ids that will be included in the release. | ||
type: array | ||
items: | ||
type: string | ||
example: | ||
- abcd1234cdef1234abcd1234cdef1234 | ||
- fff565db236400772368235db2c6117e | ||
tags: | ||
description: Only include tagged keys in the release. For a key to be included it must be tagged with all tags provided | ||
type: array | ||
items: | ||
type: string | ||
example: | ||
- android | ||
- feature1 | ||
branch: | ||
description: Branch used for release | ||
type: string | ||
example: my-feature-branch | ||
app_min_version: | ||
description: The created releases will be available only for apps with version greater or equal to this value | ||
type: string | ||
example: "1.0.0" | ||
app_max_version: | ||
description: The created releases will be available only for apps with version less or equal to this value | ||
type: string | ||
example: "2.0.0" | ||
responses: | ||
"200": | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
"$ref": "../../schemas/release_trigger.yaml#/release_trigger" | ||
headers: | ||
X-Rate-Limit-Limit: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Limit" | ||
X-Rate-Limit-Remaining: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Remaining" | ||
X-Rate-Limit-Reset: | ||
"$ref": "../../headers.yaml#/X-Rate-Limit-Reset" | ||
"400": | ||
"$ref": "../../responses.yaml#/400" | ||
"404": | ||
"$ref": "../../responses.yaml#/404" | ||
"429": | ||
"$ref": "../../responses.yaml#/429" | ||
x-code-samples: | ||
- lang: Curl | ||
source: |- | ||
curl "https://api.phrase.com/v2/accounts/:account_id/distributions/:distribution_id/release_triggers/:id" \ | ||
-u USERNAME_OR_ACCESS_TOKEN \ | ||
-X PATCH \ | ||
-d '{"cron_schedule":"15 18 * * 1,3","time_zone":"Europe/Berlin","locale_ids":["abcd1234cdef1234abcd1234cdef1234","fff565db236400772368235db2c6117e"],"tags":["android","feature1"],"branch":"my-feature-branch","app_min_version":"1.0.0","app_max_version":"2.0.0"}' \ | ||
-H 'Content-Type: application/json' | ||
- lang: CLI v2 | ||
source: |- | ||
phrase release_triggers update \ | ||
--account_id <account_id> \ | ||
--distribution_id <distribution_id> \ | ||
--id <id> \ | ||
--data '{"cron_schedule":"15 18 * * 1,3","time_zone":"Europe/Berlin","locale_ids":["abcd1234cdef1234abcd1234cdef1234","fff565db236400772368235db2c6117e"],"tags":["android","feature1"],"branch":"my-feature-branch","app_min_version":"1.0.0","app_max_version":"2.0.0"}' \ | ||
--access_token <token> | ||
x-cli-version: "2.28" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.