|
25 | 25 | import com.cloud.utils.StringUtils; |
26 | 26 | import org.apache.cloudstack.acl.RoleType; |
27 | 27 | import org.apache.cloudstack.api.APICommand; |
| 28 | +import org.apache.cloudstack.api.ApiCommandResourceType; |
28 | 29 | import org.apache.cloudstack.api.ApiConstants; |
29 | 30 | import org.apache.cloudstack.api.ApiErrorCode; |
30 | 31 | import org.apache.cloudstack.api.BaseCmd; |
|
45 | 46 | import java.util.HashMap; |
46 | 47 | import java.util.Map; |
47 | 48 |
|
48 | | -@APICommand(name = "addHSMProfile", description = "Adds a new HSM profile", responseObject = HSMProfileResponse.class, |
| 49 | +@APICommand(name = "createHSMProfile", description = "Creates a new HSM profile", responseObject = HSMProfileResponse.class, |
49 | 50 | requestHasSensitiveInfo = true, responseHasSensitiveInfo = true, since = "4.23.0", |
50 | 51 | authorized = { RoleType.Admin }) |
51 | | -public class AddHSMProfileCmd extends BaseCmd { |
| 52 | +public class CreateHSMProfileCmd extends BaseCmd { |
52 | 53 |
|
53 | 54 | @Inject |
54 | 55 | private KMSManager kmsManager; |
@@ -77,10 +78,10 @@ public class AddHSMProfileCmd extends BaseCmd { |
77 | 78 | description = "the ID of the project to add the HSM profile for") |
78 | 79 | private Long projectId; |
79 | 80 |
|
80 | | - @Parameter(name = "system", type = CommandType.BOOLEAN, |
81 | | - description = "whether this is a system HSM profile available to all users globally (root admin only). " |
| 81 | + @Parameter(name = ApiConstants.IS_PUBLIC, type = CommandType.BOOLEAN, |
| 82 | + description = "whether this is a public HSM profile available to all users globally (root admin only). " |
82 | 83 | + "Default is false") |
83 | | - private Boolean system; |
| 84 | + private Boolean isPublic; |
84 | 85 |
|
85 | 86 | @Parameter(name = ApiConstants.VENDOR_NAME, type = CommandType.STRING, description = "the vendor name of the HSM") |
86 | 87 | private String vendorName; |
@@ -116,8 +117,8 @@ public Long getProjectId() { |
116 | 117 | return projectId; |
117 | 118 | } |
118 | 119 |
|
119 | | - public Boolean isSystem() { |
120 | | - return system != null && system; |
| 120 | + public Boolean getIsPublic() { |
| 121 | + return isPublic != null && isPublic; |
121 | 122 | } |
122 | 123 |
|
123 | 124 | public String getVendorName() { |
@@ -159,4 +160,9 @@ public long getEntityOwnerId() { |
159 | 160 | } |
160 | 161 | return CallContext.current().getCallingAccount().getId(); |
161 | 162 | } |
| 163 | + |
| 164 | + @Override |
| 165 | + public ApiCommandResourceType getApiResourceType() { |
| 166 | + return ApiCommandResourceType.HsmProfile; |
| 167 | + } |
162 | 168 | } |
0 commit comments