Skip to content

Commit fa492ef

Browse files
shwstppryadvr
authored andcommitted
api: fix single domainid for create, update disk offering
createDiskOffering and updateDiskOffering will allow using both 'domainid' for signle domain association with offering and 'domainds' for multiple domains. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 76d8b6d commit fa492ef

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// under the License.
1717
package org.apache.cloudstack.api.command.admin.offering;
1818

19+
import java.util.ArrayList;
1920
import java.util.List;
2021

2122
import org.apache.cloudstack.api.APICommand;
@@ -191,6 +192,12 @@ public Long getDomainId() {
191192
}
192193

193194
public List<Long> getDomainIds() {
195+
if (domainId != null) {
196+
if (domainIds == null) {
197+
domainIds = new ArrayList<>();
198+
}
199+
domainIds.add(domainId);
200+
}
194201
return domainIds;
195202
}
196203

api/src/main/java/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// under the License.
1717
package org.apache.cloudstack.api.command.admin.offering;
1818

19+
import java.util.ArrayList;
1920
import java.util.List;
2021

2122
import org.apache.cloudstack.api.response.DomainResponse;
@@ -116,6 +117,12 @@ public Long getDomainId() {
116117
}
117118

118119
public List<Long> getDomainIds() {
120+
if (domainId != null) {
121+
if (domainIds == null) {
122+
domainIds = new ArrayList<>();
123+
}
124+
domainIds.add(domainId);
125+
}
119126
return domainIds;
120127
}
121128

0 commit comments

Comments
 (0)