Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Deployments

Deployments let the user schedule a job to deploy the contents of their workspace repository to their workspace in the Matatika cloud.

This can be done manually or via a GitHub Webhook which you can see how to set up in our Quick Start Guide: Workspace Deploy Hook


Requests


Deploy your workspace repository

POST

/api/workspaces/{workspaces-id}/deployments

Deploys the workspace {workspace-id}.

Request

Example Snippets

  • cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/af8c6d43-0e00-4c26-9020-cec32f0aa4be/deployments' -i -X POST \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'
  • Python (requests)
import requests

url = "https://catalog.matatika.com:443/api/workspaces/af8c6d43-0e00-4c26-9020-cec32f0aa4be/deployments"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("POST", url, headers=headers)

print(response.text.encode('utf8'))

Response

202 Accepted

Job with HAL links.

{
  "id" : "0ddd2a6c-8373-426a-bb95-22e787606464",
  "created" : "2023-09-20T10:47:06.394679",
  "type" : "WORKSPACE_DEPLOY",
  "status" : "QUEUED",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/jobs/0ddd2a6c-8373-426a-bb95-22e787606464"
    },
    "delete job" : {
      "href" : "https://catalog.matatika.com/api/jobs/0ddd2a6c-8373-426a-bb95-22e787606464",
      "type" : "DELETE"
    },
    "logs" : {
      "href" : "https://catalog.matatika.com/api/jobs/0ddd2a6c-8373-426a-bb95-22e787606464/logs?sequence=0",
      "type" : "GET"
    },
    "withdraw job" : {
      "href" : "https://catalog.matatika.com/api/jobs/0ddd2a6c-8373-426a-bb95-22e787606464/stopped",
      "type" : "PUT"
    }
  }
}

GitHub webhook workspace deployment

POST

/api/workspaces/{workspaces-id}/deployments/github-webhook

Receives POST requests from GitHub and starts a workspace deploy job.

Request

Example Snippets

  • cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/af8c6d43-0e00-4c26-9020-cec32f0aa4be/deployments/github-webhook' -i -X POST \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'X-Hub-Signature: sha1=bd718017bff3e6573814b5a637b75e8479b3513f' \
    -H 'Content-Type: application/json' \
    -d '{ }'
  • Python (requests)
import requests

url = "https://catalog.matatika.com:443/api/workspaces/af8c6d43-0e00-4c26-9020-cec32f0aa4be/deployments/github-webhook"

data = { }
headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("POST", url, headers=headers, data=data)

print(response.text.encode('utf8'))

Response

202 Accepted

Job with HAL links.

{
  "id" : "e5e0d514-0a6b-477c-9c6e-7be7a7a27760",
  "created" : "2023-09-20T10:47:07.172926",
  "type" : "WORKSPACE_DEPLOY",
  "status" : "QUEUED",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/jobs/e5e0d514-0a6b-477c-9c6e-7be7a7a27760"
    },
    "delete job" : {
      "href" : "https://catalog.matatika.com/api/jobs/e5e0d514-0a6b-477c-9c6e-7be7a7a27760",
      "type" : "DELETE"
    },
    "logs" : {
      "href" : "https://catalog.matatika.com/api/jobs/e5e0d514-0a6b-477c-9c6e-7be7a7a27760/logs?sequence=0",
      "type" : "GET"
    },
    "withdraw job" : {
      "href" : "https://catalog.matatika.com/api/jobs/e5e0d514-0a6b-477c-9c6e-7be7a7a27760/stopped",
      "type" : "PUT"
    }
  }
}