mirror of
https://github.com/portainer/portainer.git
synced 2025-08-03 04:45:21 +02:00
feat(azure): add experimental Azure endpoint support (#1936)
This commit is contained in:
parent
415c6ce5e1
commit
9ad9cc5e2d
52 changed files with 1665 additions and 79 deletions
17
app/azure/rest/azure.js
Normal file
17
app/azure/rest/azure.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
angular.module('portainer.azure')
|
||||
.factory('Azure', ['$http', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider',
|
||||
function AzureFactory($http, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
|
||||
'use strict';
|
||||
|
||||
var service = {};
|
||||
|
||||
service.delete = function(id, apiVersion) {
|
||||
var url = API_ENDPOINT_ENDPOINTS + '/' + EndpointProvider.endpointID() + '/azure' + id + '?api-version=' + apiVersion;
|
||||
return $http({
|
||||
method: 'DELETE',
|
||||
url: url
|
||||
});
|
||||
};
|
||||
|
||||
return service;
|
||||
}]);
|
41
app/azure/rest/container_group.js
Normal file
41
app/azure/rest/container_group.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
angular.module('portainer.azure')
|
||||
.factory('ContainerGroup', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider',
|
||||
function ContainerGroupFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
|
||||
'use strict';
|
||||
|
||||
var resource = {};
|
||||
|
||||
var base = $resource(
|
||||
API_ENDPOINT_ENDPOINTS +'/:endpointId/azure/subscriptions/:subscriptionId/providers/Microsoft.ContainerInstance/containerGroups',
|
||||
{
|
||||
'endpointId': EndpointProvider.endpointID,
|
||||
'api-version': '2018-04-01'
|
||||
},
|
||||
{
|
||||
query: { method: 'GET', params: { subscriptionId: '@subscriptionId' } }
|
||||
}
|
||||
);
|
||||
|
||||
var withResourceGroup = $resource(
|
||||
API_ENDPOINT_ENDPOINTS +'/:endpointId/azure/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.ContainerInstance/containerGroups/:containerGroupName',
|
||||
{
|
||||
'endpointId': EndpointProvider.endpointID,
|
||||
'api-version': '2018-04-01'
|
||||
},
|
||||
{
|
||||
create: {
|
||||
method: 'PUT',
|
||||
params: {
|
||||
subscriptionId: '@subscriptionId',
|
||||
resourceGroupName: '@resourceGroupName',
|
||||
containerGroupName: '@containerGroupName'
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
resource.query = base.query;
|
||||
resource.create = withResourceGroup.create;
|
||||
|
||||
return resource;
|
||||
}]);
|
12
app/azure/rest/location.js
Normal file
12
app/azure/rest/location.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
angular.module('portainer.azure')
|
||||
.factory('Location', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider',
|
||||
function LocationFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
|
||||
'use strict';
|
||||
return $resource(API_ENDPOINT_ENDPOINTS +'/:endpointId/azure/subscriptions/:subscriptionId/locations', {
|
||||
'endpointId': EndpointProvider.endpointID,
|
||||
'api-version': '2016-06-01'
|
||||
},
|
||||
{
|
||||
query: { method: 'GET', params: { subscriptionId: '@subscriptionId' } }
|
||||
});
|
||||
}]);
|
12
app/azure/rest/provider.js
Normal file
12
app/azure/rest/provider.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
angular.module('portainer.azure')
|
||||
.factory('Provider', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider',
|
||||
function ProviderFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
|
||||
'use strict';
|
||||
return $resource(API_ENDPOINT_ENDPOINTS +'/:endpointId/azure/subscriptions/:subscriptionId/providers/:providerNamespace', {
|
||||
'endpointId': EndpointProvider.endpointID,
|
||||
'api-version': '2018-02-01'
|
||||
},
|
||||
{
|
||||
get: { method: 'GET', params: { subscriptionId: '@subscriptionId', providerNamespace: '@providerNamespace' } }
|
||||
});
|
||||
}]);
|
12
app/azure/rest/resource_group.js
Normal file
12
app/azure/rest/resource_group.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
angular.module('portainer.azure')
|
||||
.factory('ResourceGroup', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider',
|
||||
function ResourceGroupFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
|
||||
'use strict';
|
||||
return $resource(API_ENDPOINT_ENDPOINTS +'/:endpointId/azure/subscriptions/:subscriptionId/resourcegroups', {
|
||||
'endpointId': EndpointProvider.endpointID,
|
||||
'api-version': '2018-02-01'
|
||||
},
|
||||
{
|
||||
query: { method: 'GET', params: { subscriptionId: '@subscriptionId' } }
|
||||
});
|
||||
}]);
|
12
app/azure/rest/subscription.js
Normal file
12
app/azure/rest/subscription.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
angular.module('portainer.azure')
|
||||
.factory('Subscription', ['$resource', 'API_ENDPOINT_ENDPOINTS', 'EndpointProvider',
|
||||
function SubscriptionFactory($resource, API_ENDPOINT_ENDPOINTS, EndpointProvider) {
|
||||
'use strict';
|
||||
return $resource(API_ENDPOINT_ENDPOINTS + '/:endpointId/azure/subscriptions', {
|
||||
'endpointId': EndpointProvider.endpointID,
|
||||
'api-version': '2016-06-01'
|
||||
},
|
||||
{
|
||||
query: { method: 'GET' }
|
||||
});
|
||||
}]);
|
Loading…
Add table
Add a link
Reference in a new issue