2016-06-07 10:49:38 +02:00
|
|
|
(function() {
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
angular
|
|
|
|
.module('harbor.services.replication.policy')
|
|
|
|
.factory('CreateReplicationPolicyService', CreateReplicationPolicyService);
|
|
|
|
|
|
|
|
CreateReplicationPolicyService.$inject = ['$http'];
|
|
|
|
|
|
|
|
function CreateReplicationPolicyService($http) {
|
2016-06-11 15:16:01 +02:00
|
|
|
return createReplicationPolicy;
|
2016-06-07 10:49:38 +02:00
|
|
|
|
|
|
|
function createReplicationPolicy(policy) {
|
|
|
|
return $http
|
|
|
|
.post('/api/policies/replication', {
|
|
|
|
'project_id': policy.projectId,
|
|
|
|
'target_id': policy.targetId,
|
|
|
|
'name': policy.name,
|
|
|
|
'enabled': policy.enabled,
|
|
|
|
'description': policy.description,
|
|
|
|
'cron_str': policy.cronStr,
|
|
|
|
'start_time': policy.startTime
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
})();
|