|
|
|
@ -2,7 +2,7 @@ angular.module('dockerui.services', ['ngResource'])
|
|
|
|
|
.factory('Container', function ($resource, Settings) {
|
|
|
|
|
'use strict';
|
|
|
|
|
// Resource for interacting with the docker containers
|
|
|
|
|
// http://docs.docker.io/en/latest/api/docker_remote_api.html#containers
|
|
|
|
|
// http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#2-1-containers
|
|
|
|
|
return $resource(Settings.url + '/containers/:id/:action', {
|
|
|
|
|
name: '@name'
|
|
|
|
|
}, {
|
|
|
|
@ -23,6 +23,7 @@ angular.module('dockerui.services', ['ngResource'])
|
|
|
|
|
})
|
|
|
|
|
.factory('ContainerCommit', function ($resource, $http, Settings) {
|
|
|
|
|
'use strict';
|
|
|
|
|
// http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#create-a-new-image-from-a-container-s-changes
|
|
|
|
|
return {
|
|
|
|
|
commit: function (params, callback) {
|
|
|
|
|
$http({
|
|
|
|
@ -40,6 +41,7 @@ angular.module('dockerui.services', ['ngResource'])
|
|
|
|
|
})
|
|
|
|
|
.factory('ContainerLogs', function ($resource, $http, Settings) {
|
|
|
|
|
'use strict';
|
|
|
|
|
// http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#get-container-logs
|
|
|
|
|
return {
|
|
|
|
|
get: function (id, params, callback) {
|
|
|
|
|
$http({
|
|
|
|
@ -59,6 +61,7 @@ angular.module('dockerui.services', ['ngResource'])
|
|
|
|
|
})
|
|
|
|
|
.factory('ContainerTop', function ($http, Settings) {
|
|
|
|
|
'use strict';
|
|
|
|
|
// http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#list-processes-running-inside-a-container
|
|
|
|
|
return {
|
|
|
|
|
get: function (id, params, callback, errorCallback) {
|
|
|
|
|
$http({
|
|
|
|
@ -73,8 +76,7 @@ angular.module('dockerui.services', ['ngResource'])
|
|
|
|
|
})
|
|
|
|
|
.factory('Image', function ($resource, Settings) {
|
|
|
|
|
'use strict';
|
|
|
|
|
// Resource for docker images
|
|
|
|
|
// http://docs.docker.io/en/latest/api/docker_remote_api.html#images
|
|
|
|
|
// http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#2-2-images
|
|
|
|
|
return $resource(Settings.url + '/images/:id/:action', {}, {
|
|
|
|
|
query: {method: 'GET', params: {all: 0, action: 'json'}, isArray: true},
|
|
|
|
|
get: {method: 'GET', params: {action: 'json'}},
|
|
|
|
@ -95,16 +97,14 @@ angular.module('dockerui.services', ['ngResource'])
|
|
|
|
|
})
|
|
|
|
|
.factory('Docker', function ($resource, Settings) {
|
|
|
|
|
'use strict';
|
|
|
|
|
// Information for docker
|
|
|
|
|
// http://docs.docker.io/en/latest/api/docker_remote_api.html#display-system-wide-information
|
|
|
|
|
// http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#show-the-docker-version-information
|
|
|
|
|
return $resource(Settings.url + '/version', {}, {
|
|
|
|
|
get: {method: 'GET'}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.factory('Auth', function ($resource, Settings) {
|
|
|
|
|
'use strict';
|
|
|
|
|
// Auto Information for docker
|
|
|
|
|
// http://docs.docker.io/en/latest/api/docker_remote_api.html#set-auth-configuration
|
|
|
|
|
// http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#check-auth-configuration
|
|
|
|
|
return $resource(Settings.url + '/auth', {}, {
|
|
|
|
|
get: {method: 'GET'},
|
|
|
|
|
update: {method: 'POST'}
|
|
|
|
@ -112,8 +112,7 @@ angular.module('dockerui.services', ['ngResource'])
|
|
|
|
|
})
|
|
|
|
|
.factory('System', function ($resource, Settings) {
|
|
|
|
|
'use strict';
|
|
|
|
|
// System for docker
|
|
|
|
|
// http://docs.docker.io/en/latest/api/docker_remote_api.html#display-system-wide-information
|
|
|
|
|
// http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#display-system-wide-information
|
|
|
|
|
return $resource(Settings.url + '/info', {}, {
|
|
|
|
|
get: {method: 'GET'}
|
|
|
|
|
});
|
|
|
|
@ -179,6 +178,7 @@ angular.module('dockerui.services', ['ngResource'])
|
|
|
|
|
})
|
|
|
|
|
.factory('Dockerfile', function (Settings) {
|
|
|
|
|
'use strict';
|
|
|
|
|
// http://docs.docker.com/reference/api/docker_remote_api_<%= remoteApiVersion %>/#build-image-from-a-dockerfile
|
|
|
|
|
var url = Settings.rawUrl + '/build';
|
|
|
|
|
return {
|
|
|
|
|
build: function (file, callback) {
|
|
|
|
|