Skip to content

Commit

Permalink
Add real examples to swagger spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Castell committed Nov 9, 2018
1 parent 20be8e5 commit df76e9c
Showing 1 changed file with 31 additions and 42 deletions.
73 changes: 31 additions & 42 deletions website/content/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ produces:
schemes:
- http
info:
version: 0.10.0
version: 0.11.2
title: Dkron REST API
description: |
You can communicate with Dkron using a RESTful JSON API over HTTP. Dkron nodes usually listen on port `8080` for API requests. All examples in this section assume that you've found a running leader at `localhost:8080`.
Expand Down Expand Up @@ -208,22 +208,27 @@ definitions:
type: string
description: "Name for the job."
readOnly: false
example: "job1"
schedule:
type: string
description: "Cron expression for the job."
readOnly: false
example: "@every 10s"
timezone:
type: string
description: "Timezone where the job will be executed. By default and when field is set to empty string, the job will run in local time."
readOnly: false
example: "Europe/Berlin"
owner:
type: string
description: "Owner of the job"
readOnly: false
example: "Platform Team"
owner_email:
type: string
description: "Email of the owner"
readOnly: false
example: "platform@example.com"
success_count:
type: integer
description: "Number of successful executions"
Expand Down Expand Up @@ -252,6 +257,8 @@ definitions:
additionalProperties:
type: string
readOnly: false
example:
dkron_server: "true"
retries:
type: integer
description: "Number of times to retry a failed job execution"
Expand Down Expand Up @@ -282,6 +289,7 @@ definitions:
type: string
description: "Executor plugin used to run the job"
readOnly: false
example: "shell"
executor_config:
$ref: '#/definitions/executor_config'
readOnly: false
Expand All @@ -292,45 +300,59 @@ definitions:
Name:
type: string
description: "Node name"
example: "dkron1"
Addr:
type: string
description: "IP Address"
example: "192.168.1.137"
Port:
type: integer
description: "Port number"
example: 8946
Tags:
type: object
description: "Tags asociated with this node"
additionalProperties:
type: string
example:
dkron_rpc_addr: "192.168.1.137:6868"
dkron_server: "true"
dkron_version": "1.0.0"
Status:
type: integer
description: "The serf status of the node see: https://godoc.org/github.com/hashicorp/serf/serf#MemberStatus"
example: 1
ProtocolMin:
type: integer
description: "Serf protocol minimum version this node can understand or speak"
example: 5
ProtocolMax:
type: integer
description: "Serf protocol maximum version this node can understand or speak"
example: 2
ProtocolCur:
type: integer
description: "Serf protocol current version this node can understand or speak"
example: 2
DelegateMin:
type: integer
description: "Serf delegate protocol minimum version this node can understand or speak"
DelegateMax:
type: integer
description: "Serf delegate protocol maximum version this node can understand or speak"
example: 5
DelegateCur:
type: integer
description: "Serf delegate protocol current version this node can understand or speak"
example: 4
execution:
type: object
description: An execution represents a timed job run.
properties:
job_name:
type: string
description: "job name"
example: "job_1"
started_at:
type: string
format: date-time
Expand All @@ -345,9 +367,11 @@ definitions:
output:
type: string
description: "partial output of the command execution"
example: "Hello from Dkron"
node_name:
type: string
description: "name of the node that executed the command"
example: "dkron1"

processors:
type: object
Expand All @@ -356,49 +380,14 @@ definitions:
type: object
additionalProperties:
type: string

processor_files:
type: object
description: Files processor save execution output to disk files.
properties:
forward:
description: Forward the output to the next processor
type: boolean
log_dir:
type: string

processor_log:
type: object
description: Log processor saves executions output to the dkron log
properties:
forward:
description: Forward the output to the next processor
type: boolean

processor_syslog:
type: object
description: Syslog processor route execution output to syslog
properties:
forward:
description: Forward the output to the next processor
type: boolean

example:
files:
forward: true

executor_config:
type: object
description: Executor plugin parameters
additionalProperties:
type: string

executor_shell:
type: object
description: Shell executor runs a command in shell
properties:
command:
description: Command to run
type: string
env:
description: Comma separated environment variables pair
example: FOO=bar
type: string
shell:
type: boolean
example:
command: "echo 'Hello from Dkron'"

0 comments on commit df76e9c

Please sign in to comment.