MCPcopy Index your code
hub / github.com/scality/cloudserver / addRoutingRule

Method addRoutingRule

tests/unit/helpers.js:115–133  ·  view source on GitHub ↗
(redirectParams, conditionParams)

Source from the content-addressed store, hash-verified

113 }
114 }
115 addRoutingRule(redirectParams, conditionParams) {
116 const newRule = {};
117 if (!this.RoutingRules) {
118 this.RoutingRules = [];
119 }
120 if (redirectParams) {
121 newRule.Redirect = {};
122 Object.keys(redirectParams).forEach(key => {
123 newRule.Redirect[key] = redirectParams[key];
124 });
125 }
126 if (conditionParams) {
127 newRule.Condition = {};
128 Object.keys(conditionParams).forEach(key => {
129 newRule.Condition[key] = conditionParams[key];
130 });
131 }
132 this.RoutingRules.push(newRule);
133 }
134 getXml() {
135 const xml = [];
136 function _pushChildren(obj) {

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected