Skip to content

Commit

Permalink
chore: update playbook spec openapi schema
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Mar 13, 2024
1 parent 2f36131 commit c383278
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ download-openapi-schemas:
# Cleanup
rm -rf tmp


cp-playbook-schema:
cp ../incident-commander/config/schemas/playbook-spec.schema.json schema/

fmt_json:
ls fixtures/expectations/*.json | while read -r jf; do \
cat <<< $$(jq . $$jf) > $$jf; \
Expand Down
1 change: 1 addition & 0 deletions schema/playbook-spec.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookSpec","definitions":{"AWSConnection":{"properties":{"connection":{"type":"string"},"accessKey":{"$ref":"#/definitions/EnvVar"},"secretKey":{"$ref":"#/definitions/EnvVar"},"sessionToken":{"$ref":"#/definitions/EnvVar"},"region":{"type":"string"},"endpoint":{"type":"string"},"skipTLSVerify":{"type":"boolean"},"objectPath":{"type":"string"},"usePathStyle":{"type":"boolean"}},"additionalProperties":false,"type":"object"},"Artifact":{"required":["path"],"properties":{"path":{"type":"string"}},"additionalProperties":false,"type":"object"},"AzureConnection":{"properties":{"connection":{"type":"string"},"clientID":{"$ref":"#/definitions/EnvVar"},"clientSecret":{"$ref":"#/definitions/EnvVar"},"tenantID":{"type":"string"}},"additionalProperties":false,"type":"object"},"AzureDevopsPipeline":{"required":["id"],"properties":{"id":{"type":"string"},"version":{"type":"string"}},"additionalProperties":false,"type":"object"},"AzureDevopsPipelineAction":{"required":["org","project","token","pipeline"],"properties":{"org":{"type":"string"},"project":{"type":"string"},"token":{"$ref":"#/definitions/EnvVar"},"pipeline":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/AzureDevopsPipeline"},"parameters":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/AzureDevopsPipelineParameters"}},"additionalProperties":false,"type":"object"},"AzureDevopsPipelineParameters":{"properties":{"resources":{"additionalProperties":true},"templateParameters":{"additionalProperties":true},"variables":{"additionalProperties":true},"stagesToSkip":{"items":{"type":"string"},"type":"array"}},"additionalProperties":false,"type":"object"},"ConfigMapKeySelector":{"required":["key"],"properties":{"name":{"type":"string"},"key":{"type":"string"}},"additionalProperties":false,"type":"object"},"EnvVar":{"properties":{"name":{"type":"string"},"value":{"type":"string"},"valueFrom":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/EnvVarSource"}},"additionalProperties":false,"type":"object"},"EnvVarSource":{"properties":{"serviceAccount":{"type":"string"},"helmRef":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/HelmRefKeySelector"},"configMapKeyRef":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/ConfigMapKeySelector"},"secretKeyRef":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/SecretKeySelector"}},"additionalProperties":false,"type":"object"},"ExecAction":{"required":["script"],"properties":{"script":{"type":"string"},"connections":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/ExecConnections"},"artifacts":{"items":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/Artifact"},"type":"array"},"env":{"items":{"$ref":"#/definitions/EnvVar"},"type":"array"},"checkout":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/GitCheckout"}},"additionalProperties":false,"type":"object"},"ExecConnections":{"properties":{"aws":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/AWSConnection"},"gcp":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/GCPConnection"},"azure":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/AzureConnection"}},"additionalProperties":false,"type":"object"},"GCPConnection":{"properties":{"connection":{"type":"string"},"endpoint":{"type":"string"},"credentials":{"$ref":"#/definitions/EnvVar"}},"additionalProperties":false,"type":"object"},"GitCheckout":{"properties":{"url":{"type":"string"},"connection":{"type":"string"},"username":{"$ref":"#/definitions/EnvVar"},"password":{"$ref":"#/definitions/EnvVar"},"certificate":{"$ref":"#/definitions/EnvVar"},"destination":{"type":"string"}},"additionalProperties":false,"type":"object"},"GitOpsAction":{"required":["repo","commit"],"properties":{"repo":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/GitOpsActionRepo"},"commit":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/GitOpsActionCommit"},"pr":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/GitOpsActionPR"},"patches":{"items":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/GitOpsActionPatch"},"type":"array"},"files":{"items":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/GitOpsActionFile"},"type":"array"}},"additionalProperties":false,"type":"object"},"GitOpsActionCommit":{"required":["author","email","message"],"properties":{"author":{"type":"string"},"email":{"type":"string"},"message":{"type":"string"}},"additionalProperties":false,"type":"object"},"GitOpsActionFile":{"required":["path","content"],"properties":{"path":{"type":"string"},"content":{"type":"string"}},"additionalProperties":false,"type":"object"},"GitOpsActionPR":{"required":["title"],"properties":{"title":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"}},"additionalProperties":false,"type":"object"},"GitOpsActionPatch":{"required":["path"],"properties":{"path":{"type":"string"},"yq":{"type":"string"},"jq":{"type":"string"}},"additionalProperties":false,"type":"object"},"GitOpsActionRepo":{"required":["url"],"properties":{"url":{"type":"string"},"base":{"type":"string"},"branch":{"type":"string"},"connection":{"type":"string"},"type":{"type":"string"}},"additionalProperties":false,"type":"object"},"GithubAction":{"required":["repo","username","token"],"properties":{"repo":{"type":"string"},"username":{"type":"string"},"token":{"$ref":"#/definitions/EnvVar"},"workflows":{"items":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/GithubWorkflow"},"type":"array"}},"additionalProperties":false,"type":"object"},"GithubWorkflow":{"required":["id"],"properties":{"id":{"type":"string"},"ref":{"type":"string"},"input":{"type":"string"}},"additionalProperties":false,"type":"object"},"HTTPAction":{"properties":{"connection":{"type":"string"},"url":{"type":"string"},"username":{"$ref":"#/definitions/EnvVar"},"password":{"$ref":"#/definitions/EnvVar"},"method":{"type":"string"},"ntlm":{"type":"boolean"},"ntlmv2":{"type":"boolean"},"headers":{"items":{"$ref":"#/definitions/EnvVar"},"type":"array"},"body":{"type":"string"},"templateBody":{"type":"boolean"}},"additionalProperties":false,"type":"object"},"HelmRefKeySelector":{"required":["key"],"properties":{"name":{"type":"string"},"key":{"type":"string"}},"additionalProperties":false,"type":"object"},"NotificationAction":{"required":["title","message"],"properties":{"url":{"type":"string"},"connection":{"type":"string"},"title":{"type":"string"},"message":{"type":"string"},"properties":{"patternProperties":{".*":{"type":"string"}},"type":"object"}},"additionalProperties":false,"type":"object"},"Permission":{"properties":{"role":{"type":"string"},"team":{"type":"string"},"ref":{"type":"string"}},"additionalProperties":false,"type":"object"},"PlaybookAction":{"required":["name"],"properties":{"name":{"type":"string"},"delay":{"type":"string"},"timeout":{"type":"string"},"if":{"type":"string"},"runsOn":{"items":{"type":"string"},"type":"array"},"templatesOn":{"type":"string"},"exec":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/ExecAction"},"gitops":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/GitOpsAction"},"github":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/GithubAction"},"azureDevopsPipeline":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/AzureDevopsPipelineAction"},"http":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/HTTPAction"},"sql":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/SQLAction"},"pod":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PodAction"},"notification":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/NotificationAction"}},"additionalProperties":false,"type":"object"},"PlaybookApproval":{"properties":{"type":{"type":"string"},"approvers":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookApprovers"}},"additionalProperties":false,"type":"object"},"PlaybookApprovers":{"properties":{"people":{"items":{"type":"string"},"type":"array"},"teams":{"items":{"type":"string"},"type":"array"}},"additionalProperties":false,"type":"object"},"PlaybookEventWebhookAuth":{"properties":{"basic":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookEventWebhookAuthBasic"},"github":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookEventWebhookAuthGithub"},"svix":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookEventWebhookAuthSVIX"},"jwt":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookEventWebhookAuthJWT"}},"additionalProperties":false,"type":"object"},"PlaybookEventWebhookAuthBasic":{"required":["username","password"],"properties":{"username":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/EnvVar"},"password":{"$ref":"#/definitions/EnvVar"}},"additionalProperties":false,"type":"object"},"PlaybookEventWebhookAuthGithub":{"required":["token"],"properties":{"token":{"$ref":"#/definitions/EnvVar"}},"additionalProperties":false,"type":"object"},"PlaybookEventWebhookAuthJWT":{"required":["jwksUri"],"properties":{"jwksUri":{"type":"string"}},"additionalProperties":false,"type":"object"},"PlaybookEventWebhookAuthSVIX":{"required":["secret"],"properties":{"secret":{"$ref":"#/definitions/EnvVar"},"verifyTimestamp":{"type":"string"}},"additionalProperties":false,"type":"object"},"PlaybookParameter":{"required":["name","label"],"properties":{"name":{"type":"string"},"default":{"type":"string"},"label":{"type":"string"},"required":{"type":"boolean"},"icon":{"type":"string"},"description":{"type":"string"},"type":{"type":"string"},"properties":{"additionalProperties":true}},"additionalProperties":false,"type":"object"},"PlaybookResourceFilter":{"properties":{"type":{"type":"string"},"tags":{"patternProperties":{".*":{"type":"string"}},"type":"object"}},"additionalProperties":false,"type":"object"},"PlaybookSpec":{"required":["actions"],"properties":{"description":{"type":"string"},"icon":{"type":"string"},"on":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookTrigger"},"runsOn":{"items":{"type":"string"},"type":"array"},"env":{"items":{"$ref":"#/definitions/EnvVar"},"type":"array"},"templatesOn":{"type":"string"},"permissions":{"items":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/Permission"},"type":"array"},"configs":{"items":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/ResourceSelector"},"type":"array"},"checks":{"items":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookResourceFilter"},"type":"array"},"components":{"items":{"$ref":"#/definitions/PlaybookResourceFilter"},"type":"array"},"parameters":{"items":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookParameter"},"type":"array"},"actions":{"items":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookAction"},"type":"array"},"filters":{"items":{"type":"string"},"type":"array"},"approval":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookApproval"}},"additionalProperties":false,"type":"object"},"PlaybookTrigger":{"properties":{"canary":{"items":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookTriggerEvent"},"type":"array"},"config":{"items":{"$ref":"#/definitions/PlaybookTriggerEvent"},"type":"array"},"component":{"items":{"$ref":"#/definitions/PlaybookTriggerEvent"},"type":"array"},"webhook":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookTriggerWebhook"}},"additionalProperties":false,"type":"object"},"PlaybookTriggerEvent":{"required":["event"],"properties":{"event":{"type":"string"},"labels":{"patternProperties":{".*":{"type":"string"}},"type":"object"},"filter":{"type":"string"}},"additionalProperties":false,"type":"object"},"PlaybookTriggerWebhook":{"required":["path"],"properties":{"path":{"type":"string"},"authentication":{"$schema":"http://json-schema.org/draft-04/schema#","$ref":"#/definitions/PlaybookEventWebhookAuth"}},"additionalProperties":false,"type":"object"},"PodAction":{"required":["name","spec"],"properties":{"name":{"type":"string"},"maxLength":{"type":"integer"},"spec":{"additionalProperties":true},"artifacts":{"items":{"$ref":"#/definitions/Artifact"},"type":"array"}},"additionalProperties":false,"type":"object"},"ResourceSelector":{"properties":{"agent":{"type":"string"},"cache":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"namespace":{"type":"string"},"types":{"items":{"type":"string"},"type":"array"},"statuses":{"items":{"type":"string"},"type":"array"},"labelSelector":{"type":"string"},"fieldSelector":{"type":"string"}},"additionalProperties":false,"type":"object"},"SQLAction":{"required":["query","driver"],"properties":{"connection":{"type":"string"},"url":{"type":"string"},"query":{"type":"string"},"driver":{"type":"string"}},"additionalProperties":false,"type":"object"},"SecretKeySelector":{"required":["key"],"properties":{"name":{"type":"string"},"key":{"type":"string"}},"additionalProperties":false,"type":"object"}}}

0 comments on commit c383278

Please sign in to comment.