Skip to content

Latest commit

 

History

History
368 lines (272 loc) · 8.39 KB

api.md

File metadata and controls

368 lines (272 loc) · 8.39 KB

Stencil server v0.1.4

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

health

ping

Code samples

# You can also use wget
curl -X GET /ping

GET /ping

service health check

Responses

Status Meaning Description Schema
200 OK returns pong message None
This operation does not require authentication

StencilService

post__v1_namespaces_{namespace}_descriptors

Code samples

# You can also use wget
curl -X POST /v1/namespaces/{namespace}/descriptors \
  -H 'Content-Type: multipart/form-data'

POST /v1/namespaces/{namespace}/descriptors

upload descriptors

Body parameter

name: string
version: string
latest: true
dryrun: true
skiprules:
  - FILE_NO_BREAKING_CHANGE
file: string

Parameters

Name In Type Required Description
namespace path string true none
body body object true none
» name body string true none
» version body string true version number for descriptor file. This should follow semantic version compatability
» latest body boolean false mark this descriptor file as latest
» dryrun body boolean false flag for dryRun
» skiprules body [string] false list of rules to skip
» file body string(binary) true descriptorset file to upload

Enumerated Values

Parameter Value
» skiprules FILE_NO_BREAKING_CHANGE
» skiprules MESSAGE_NO_DELETE
» skiprules FIELD_NO_BREAKING_CHANGE
» skiprules ENUM_NO_BREAKING_CHANGE

Responses

Status Meaning Description Schema
200 OK Success response if operation succeded None
400 Bad Request Validation error response when user payload has missing required fields or currently being uploaded file is not backward compatible with previously uploaded file None
409 Conflict conflict error reponse if namespace, name and version combination already present None
500 Internal Server Error Unexpected internal error reponse None
This operation does not require authentication

get__v1_namespaces_{namespace}descriptors{name}versions{version}

Code samples

# You can also use wget
curl -X GET /v1/namespaces/{namespace}/descriptors/{name}/versions/{version}

GET /v1/namespaces/{namespace}/descriptors/{name}/versions/{version}

download specified descriptor file

Parameters

Name In Type Required Description
namespace path string true none
name path string true none
version path string true none
fullnames query array[string] false Proto fullnames

Responses

Status Meaning Description Schema
200 OK download response None
This operation does not require authentication

StencilService_ListSnapshots

Code samples

# You can also use wget
curl -X GET /v1/snapshots \
  -H 'Accept: application/json'

GET /v1/snapshots

Parameters

Name In Type Required Description
namespace query string false none
name query string false none
version query string false none
latest query boolean false none

Example responses

200 Response

{
  "snapshots": [
    {
      "id": "string",
      "namespace": "string",
      "name": "string",
      "version": "string",
      "latest": true
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK A successful response. v1ListSnapshotsResponse
default Default An unexpected error response. rpcStatus
This operation does not require authentication

StencilService_PromoteSnapshot

Code samples

# You can also use wget
curl -X PATCH /v1/snapshots/{id}/promote \
  -H 'Accept: application/json'

PATCH /v1/snapshots/{id}/promote

PromoteSnapshot promotes particular snapshot version as latest

Parameters

Name In Type Required Description
id path string(int64) true none

Example responses

200 Response

{
  "snapshot": {
    "id": "string",
    "namespace": "string",
    "name": "string",
    "version": "string",
    "latest": true
  }
}

Responses

Status Meaning Description Schema
200 OK A successful response. v1PromoteSnapshotResponse
default Default An unexpected error response. rpcStatus
This operation does not require authentication

Schemas

protobufAny

{
  "typeUrl": "string",
  "value": "string"
}

Properties

Name Type Required Restrictions Description
typeUrl string false none none
value string(byte) false none none

rpcStatus

{
  "code": 0,
  "message": "string",
  "details": [
    {
      "typeUrl": "string",
      "value": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
code integer(int32) false none none
message string false none none
details [protobufAny] false none none

v1ListSnapshotsResponse

{
  "snapshots": [
    {
      "id": "string",
      "namespace": "string",
      "name": "string",
      "version": "string",
      "latest": true
    }
  ]
}

Properties

Name Type Required Restrictions Description
snapshots [v1Snapshot] false none none

v1PromoteSnapshotResponse

{
  "snapshot": {
    "id": "string",
    "namespace": "string",
    "name": "string",
    "version": "string",
    "latest": true
  }
}

Properties

Name Type Required Restrictions Description
snapshot v1Snapshot false none none

v1Snapshot

{
  "id": "string",
  "namespace": "string",
  "name": "string",
  "version": "string",
  "latest": true
}

Properties

Name Type Required Restrictions Description
id string(int64) false none none
namespace string true none none
name string false none none
version string false none none
latest boolean false none none