Skip to content

Tutorials 

edgeEngine mCM API

mimik Container API

Get
/images
get a list of images

Retrieves a list of images cached locally on the node

Parameters
No parameters
Responses
Response content type
Code Description
200

Get the images

            "data": [
			    {
			      "id": "sha256:4dcab49015d4",
			      "name": "mimik/mdrive/v1",
			      "repoDigests": [
			        [
			          "sha256:4dcab49015d4",
			          "sha256:3c9clb11a52b"
			        ]
			      ],
			      "created": 1505947350,
			      "size": 1024,
			      "containers": 2
			    }
			  ]
			}
Post
/images
Create a image by uploading the image bundle

create a image by uploading the image bundle

Parameters
Name Description

newImage *required

object

(body)

the image information

{
  "url": "http://containerregistry.com/example.",
  "base64Image": "string"
}            

Parameter content type

mode

string

(query)

Switch to toggle from downloading the payload to downloading the reference of the payload.

Available values : payload, reference

Default value : reference

Responses
Response content type
Code Description
201

Image created successfully

{
  "url": "http://containerregistry.com/example.",
  "base64Image": "string"
}            
Delete
/images{id}
Remove a image

remove a image

Parameters
Name Description

id *required

string

(path)

GUID ot identify the image

id – GUID ot identify the image

Responses
Response content type
Code Description
200

Deleted Image Information

{
  "id": "sha256:4dcab49015d4",
  "name": "mimik/mdrive/v1",
  "repoDigests": [
    [
      "sha256:4dcab49015d4",
      "sha256:3c9clb11a52b"
    ]
  ],
  "created": 1505947350,
  "size": 1024,
  "containers": 2
}           
404 image cannot be found
Get
/containers
get a list of containers

Retrieves a list of containers created on this node

Parameters
No parameters
Responses
Response content type
Code Description
200

list of containers

{
  "data": [
    {
      "id": "string",
      "image": "string",
      "imageId": "string",
      "created": 0,
      "state": "created",
      "env": [
        "string"
      ]
    }
  ]
}
Post
/containers
Create a instance of container from a image

create an instance of container from a image

Parameters
Name Description

newContainer *required

object

(body)

the container information

{
  "name": "string",
  "image": "string",
  "env": [
    "string"
  ]
}           

Parameter content type

Responses
Response content type
Code Description
201

New Container Information

{
  "id": "string",
  "image": "string",
  "imageId": "string",
  "created": 0,
  "state": "created",
  "env": [
    "string"
  ]
}           
Put
/containers{id}
Start stop a container

start/stop a container

Parameters
Name Description

id *required

string

(path)

GUID ot identify the image

id – GUID ot identify the image

Action *required

object

(body)

the container state

{
  "action": "start"
}          

Parameter content type

Responses
Response content type
Code Description
200

Updated Container Information

{
  "data": {}
}          
404 container not found
Delete
/containers/{id}
remove a container

removes a container

Parameters
Name Description

id *required

string

(path)

GUID ot identify the image

id – GUID ot identify the image

Responses
Response content type
Code Description
200

Deleted Container Information

{
  "id": "string",
  "image": "string",
  "imageId": "string",
  "created": 0,
  "state": "created",
  "env": [
    "string"
  ]
}          
404 container not found
Image
description: image object
id

string

example: sha256:4dcab49015d4

A mimik image’s ID is a digest, which contains an SHA256 hash of the image’s JSON configuration object

name

string

example: mimik/mdrive/v1

An image name is made up of slash-separated name components, optionally prefixed by a registry hostname. The hostname must comply with standard DNS rules, but may not contain underscores.

repoDigests [

an array of filesystem layer of the container

string

example: List [ “sha256:4dcab49015d4”, “sha256:3c9clb11a52b” ]]
created

integer

example: 1505947350

the epoch time in second

size

integer

example: 1024

the size of the image in bytes

containers

integer

example: 2

the number of containers created from this image

Images
[{
description: image object
id

string

example: sha256:4dcab49015d4

A mimik image’s ID is a digest, which contains an SHA256 hash of the image’s JSON configuration object

name

string

example: mimik/mdrive/v1

An image name is made up of slash-separated name components, optionally prefixed by a registry hostname. The hostname must comply with standard DNS rules, but may not contain underscores.

repoDigests [

an array of filesystem layer of the container

string

example: List [ “sha256:4dcab49015d4”, “sha256:3c9clb11a52b” ]]
created

integer

example: 1505947350

the epoch time in second

size

integer

example: 1024

the size of the image in bytes

containers

integer

example: 2

the number of containers created from this image

}]
Container
{
description: container object
id

string

A GUID generated by the system

image

string

The name of the image used

imageId

string

The id of the image used

created

integer

date the container is created. Epoch in seconds

state

string

default: created

the state of container. Valid strings are created|running|removing|paused Please note that in docker they have restarting|exited|dead, but does not make sense in the light container.

Enum:

[ created, running, removing, paused ]

env

string

[A list of environment variables to set inside the container in the form [“VAR=value”, …]. A variable without = is removed from the environment, rather than to have an empty value. Please note that this properties will be filtered out when make the request because it may contain sensitive data that needs to be used to initialize the container]

}
Containers
[{
description: container object
id

string

A GUID generated by the system

image

string

The name of the image used

imageId

string

The id of the image used

created

integer

date the container is created. Epoch in seconds

state

string

default: created

the state of container. Valid strings are created|running|removing|paused Please note that in docker they have restarting|exited|dead, but does not make sense in the light container.

Enum:

[ created, running, removing, paused ]

env

string

[A list of environment variables to set inside the container in the form [“VAR=value”, …]. A variable without = is removed from the environment, rather than to have an empty value. Please note that this properties will be filtered out when make the request because it may contain sensitive data that needs to be used to initialize the container]

}]
NewImage
[
description: image creation object
url

string

example: http://containerregistry.com/example.

url to retrive the container image

base64Image

string

a base64 encoded container image

}
Action
{
description: updated container object
action

string

example: start default: start

Valid strings are start|stop

Enum:

[ start, stop ]

}
NewContainer
{
description: new container object
name

string

name for the container. Please note that Docker allows one to give more than one name to a container.

image

string

The name of the image to use when creating the container

env

string

[A list of environment variables to set inside the container in the form [“VAR=value”, …]. A variable without = is removed from the environment, rather than to have an empty value.]

}

Your feedback is important to us ~