Upload Package Bits
Upload package bits
This upload endpoint takes a multi-part form requests for packages of type bits. The request requires either a .zip file uploaded under the bits field or a list of resource match objects under the resources field. These field may be used together.
Request
URI
POST
https://api.example.local/v3/packages/{guid}/upload
COPY
Path Parameters
string
guid
Required
The unique identifier for the resource
Request Body
{
"resources": [
{
"path": "string",
"size_in_bytes": 0,
"checksum": {
"value": "string"
}
}
]
}
array of
object
resources
Optional
resources
Responses
200
Successfully uploaded package bits
Returns
Package
of type(s)
application/json
This response body class contains all of the following:
BaseSchema
{
"guid": "string",
"created_at": "string",
"updated_at": "string",
"type": "string",
"data": {
"error": "string",
"checksum": {
"type": "string",
"value": "string"
},
"image": "string",
"username": "string",
"password": "string"
},
"state": "string",
"relationships": {},
"metadata": {
"labels": {
"labels": "string"
},
"annotations": {
"annotations": "string"
}
},
"links": {
"self": {
"href": "string",
"method": "string"
},
"upload": {
"href": "string",
"method": "string"
},
"download": {
"href": "string",
"method": "string"
},
"app": {
"href": "string",
"method": "string"
}
}
}
202
Upload initiated
Returns
Package
of type(s)
application/json
This response body class contains all of the following:
BaseSchema
{
"guid": "string",
"created_at": "string",
"updated_at": "string",
"type": "string",
"data": {
"error": "string",
"checksum": {
"type": "string",
"value": "string"
},
"image": "string",
"username": "string",
"password": "string"
},
"state": "string",
"relationships": {},
"metadata": {
"labels": {
"labels": "string"
},
"annotations": {
"annotations": "string"
}
},
"links": {
"self": {
"href": "string",
"method": "string"
},
"upload": {
"href": "string",
"method": "string"
},
"download": {
"href": "string",
"method": "string"
},
"app": {
"href": "string",
"method": "string"
}
}
}
Response Headers
string
Location
URL of the job tracking the upload
401
Unauthorized
Returns
Unauthorized
of type(s)
application/json
{
"errors": [
{
"code": 0,
"detail": "string",
"title": "string"
}
]
}
array of
object
errors
Optional
errors
403
Forbidden
Returns
Forbidden
of type(s)
application/json
{
"errors": [
{
"code": 0,
"detail": "string",
"title": "string"
}
]
}
array of
object
errors
Optional
errors
404
Not Found
Returns
NotFound
of type(s)
application/json
{
"errors": [
{
"code": 0,
"detail": "string",
"title": "string"
}
]
}
array of
object
errors
Optional
errors
422
Unprocessable Entity
Returns
UnprocessableEntity
of type(s)
application/json
{
"errors": [
{
"code": 0,
"detail": "string",
"title": "string"
}
]
}
array of
object
errors
Optional
errors
Code Samples
COPY
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: multipart/form-data' -d '{}' https://{api_host}/v3/packages/{guid}/upload