2020-06-09 02:43:32 +00:00
|
|
|
import { ResourceGroupViewModel } from '../models/resource_group';
|
|
|
|
|
|
|
|
angular.module('portainer.azure').factory('ResourceGroupService', [
|
|
|
|
'$q',
|
|
|
|
'ResourceGroup',
|
|
|
|
function ResourceGroupServiceFactory($q, ResourceGroup) {
|
|
|
|
'use strict';
|
|
|
|
var service = {};
|
|
|
|
|
2020-07-20 21:08:20 +00:00
|
|
|
service.resourceGroup = resourceGroup;
|
|
|
|
async function resourceGroup(subscriptionId, resourceGroupName) {
|
|
|
|
const group = await ResourceGroup.get({ subscriptionId, resourceGroupName }).$promise;
|
|
|
|
return new ResourceGroupViewModel(group);
|
|
|
|
}
|
|
|
|
|
2020-06-09 02:43:32 +00:00
|
|
|
return service;
|
|
|
|
},
|
|
|
|
]);
|