Drawbridge (0.1.0)

Download OpenAPI specification:Download

Node

  • A node is either a file or a directory, where directory is a collection of node entries.
  • A node may belong to multiple directory nodes.
  • A node in a directory is identified by a case-sensitive name consisting of alphanumeric characters, dashes and underscores and must represent valid URL string, which is unique within a directory.

Inherent properties

Contents

All nodes have contents associated with them.

Directory node contents

Contents of a directory node is a key-value object with keys representing the node names and values representing node entries.

For example:

{
  "assets": {
    "digest": {
      "sha256": "n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg",
      "sha384": "DH01Tx3ixOrDYbNcjqw+H53EIFSI232hbotDTy1E/NU6+qodYhdrswrXoEfx/nnx"
    },
    "from": "myassets:0.1.2"
  },
  "Enarx.toml": {
    "digest": {
      "sha256": "DodjLNRr1JB8UWMX622B/g+SGiPHZDAY8hKSiUtHBoE",
      "sha384": "mqVuAfXRKap7bdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC"
    }
  }
}

File node contents

Contents of a file node is binary data of an arbitrary media type other than "application/vnd.drawbridge.directory.v1+json"

Media type

All nodes have a media type associated with them.

Directory node content type

"application/vnd.drawbridge.directory.v1+json" type identifies a directory node.

File node content type

Any other type than "application/vnd.drawbridge.directory.v1+json" identifies a file node.

Content length

All nodes have a content length associated with them.

Directory node content length

Content length of a directory node is equal to byte length of JSON-encoded directory contents without whitespace characters.

File node content length

Content length of a file nodes is equal to byte length of raw file contents.

Content digest

All nodes have a content digest associated with them.

Directory node content digest

Content digest of a directory node is equal to hash of lexicographically-sorted JSON-encoded directory contents without whitespace characters.

For example, sha256 content digest of a directory with following contents:

{
  "assets": {
    "digest": {
      "sha256": "n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg",
      "sha384": "DH01Tx3ixOrDYbNcjqw+H53EIFSI232hbotDTy1E/NU6+qodYhdrswrXoEfx/nnx"
    },
    "from": "myassets:0.1.2"
  },
  "Enarx.toml": {
    "digest": {
      "sha256": "DodjLNRr1JB8UWMX622B/g+SGiPHZDAY8hKSiUtHBoE",
      "sha384": "mqVuAfXRKap7bdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC"
    }
  }
}

is equal to Z2oGasnuiV+nldtPLGf+wWDQ14nhUVjbeL8So4Zr1aA

File node content digest

Content digest of a file nodes is equal to hash of raw file contents.

Entry

Node entry is a combination of exherent properties of the node (for example, from, representing the source from which it was mirrored, if applicable) and digest of its inherent properties.

For example, sha384 digest computed over following inherent properties of a file node:

{
  "contentDigest": {
    "sha384": "mqVuAfXRKap7bdgcCY5uykM6-R9GqQ8K_uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC"
  },
  "contentLength": 42,
  "contentType": "text/plain"
}

is equal to:

7QuaGUAIdLBb9ZzarCY0ybasXdU6QhQzMkXAIiS8UwjDZBLWLNSr4Vhz2Kh+/R9r

Tag

An immutable mapping of a semver version string to a node entry.

Tree

A node entry identified by a tag.

List available tags.

List available tags.

Responses

Response samples

Content type
application/json
[
  • "0.5.3",
  • "1.2.3",
  • "1.2.4",
  • "2.0.1-rc1"
]

Check whether a tag exists.

Check whether a tag exists.

path Parameters
tag
required
string (SemVer) ^[a-zA-Z0-9-.]+$
Example: 1.2.3

A semantic version string.

Responses

Get a tree node entry associated with a tag.

Get a tree node entry associated with a tag.

path Parameters
tag
required
string (SemVer) ^[a-zA-Z0-9-.]+$
Example: 1.2.3

A semantic version string.

Responses

Response samples

Content type
application/json
{
  • "digest": {
    }
}

Create a tag.

Create a tag.

path Parameters
tag
required
string (SemVer) ^[a-zA-Z0-9-.]+$
Example: 1.2.3

A semantic version string.

Request Body schema: application/json
required
object

Digests of inherent properties of a node.

Responses

Request samples

Content type
application/json
{
  • "digest": {
    }
}

Yank a tag.

Yank a tag.

path Parameters
tag
required
string (SemVer) ^[a-zA-Z0-9-.]+$
Example: 1.2.3

A semantic version string.

Responses

Check whether a tree path exists.

Check whether a tree path exists.

path Parameters
tag
required
string (SemVer) ^[a-zA-Z0-9-.]+$
Example: 1.2.3

A semantic version string.

path
string^[a-zA-Z0-9-_.,]+(/[a-zA-Z0-9-_.,])+$
Example: foo/bar/baz/file.txt

Slash-delimited file path to a node within a tree.

Responses

Get tree path contents.

Get tree path contents.

path Parameters
tag
required
string (SemVer) ^[a-zA-Z0-9-.]+$
Example: 1.2.3

A semantic version string.

path
string^[a-zA-Z0-9-_.,]+(/[a-zA-Z0-9-_.,])+$
Example: foo/bar/baz/file.txt

Slash-delimited file path to a node within a tree.

Responses

Response samples

Content type
{
  • "assets": {
    },
  • "Enarx.toml": {
    }
}

Upload tree path contents.

Upload tree path contents.

path Parameters
tag
required
string (SemVer) ^[a-zA-Z0-9-.]+$
Example: 1.2.3

A semantic version string.

path
string^[a-zA-Z0-9-_.,]+(/[a-zA-Z0-9-_.,])+$
Example: foo/bar/baz/file.txt

Slash-delimited file path to a node within a tree.

header Parameters
Content-Digest
required
string (ContentDigest) ^\*sha(224|256|384|512)=:[a-zA-Z0-9-_]{38,86}...
Example: sha-256=:4REjxQ4yrqUVicfSKYNO/cF9zNj5ANbzgDZt3/h3Qxo=:,\sha-512=:WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX+TaPm+AbwAgBWnrI\iYllu7BNNyealdVLvRwEmTHWXvJwew==:
Content-Length
required
integer <int64> (ContentLength)
Example: 42

Node content length in bytes.

Content-Type
required
string (ContentType) ^(application|audio|image|text)/[a-zA-Z0-9-_....
Example: application/vnd.drawbridge.directory.v1+json

Node media type.

Request Body schema:
additional property
object (Entry)

A node entry.

Responses

Request samples

Content type
{
  • "assets": {
    },
  • "Enarx.toml": {
    }
}