mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Add ID search capability to sshkeypairs (#5963)
This commit is contained in:
parent
c7885f55eb
commit
453aeb02f0
@ -40,6 +40,8 @@ public class ListSSHKeyPairsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
//////////////// API parameters /////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = SSHKeyPairResponse.class, description = "the ID of the ssh keypair")
|
||||
private Long id;
|
||||
|
||||
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "A key pair name to look for")
|
||||
private String name;
|
||||
@ -50,6 +52,9 @@ public class ListSSHKeyPairsCmd extends BaseListProjectAndAccountResourcesCmd {
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////////// Accessors ///////////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
|
||||
@ -21,8 +21,12 @@ import com.google.gson.annotations.SerializedName;
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
|
||||
import com.cloud.serializer.Param;
|
||||
import org.apache.cloudstack.api.BaseResponseWithAnnotations;
|
||||
import com.cloud.user.SSHKeyPair;
|
||||
|
||||
import org.apache.cloudstack.api.BaseResponseWithAnnotations;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
@EntityReference(value = SSHKeyPair.class)
|
||||
public class SSHKeyPairResponse extends BaseResponseWithAnnotations {
|
||||
|
||||
@SerializedName(ApiConstants.ID)
|
||||
|
||||
@ -4150,6 +4150,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
|
||||
|
||||
@Override
|
||||
public Pair<List<? extends SSHKeyPair>, Integer> listSSHKeyPairs(final ListSSHKeyPairsCmd cmd) {
|
||||
final Long id = cmd.getId();
|
||||
final String name = cmd.getName();
|
||||
final String fingerPrint = cmd.getFingerprint();
|
||||
final String keyword = cmd.getKeyword();
|
||||
@ -4169,6 +4170,10 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
|
||||
final SearchCriteria<SSHKeyPairVO> sc = sb.create();
|
||||
_accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria);
|
||||
|
||||
if (id != null) {
|
||||
sc.addAnd("id", SearchCriteria.Op.EQ, id);
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
sc.addAnd("name", SearchCriteria.Op.EQ, name);
|
||||
}
|
||||
|
||||
@ -605,7 +605,7 @@
|
||||
<div v-for="item in $route.meta.related" :key="item.path">
|
||||
<router-link
|
||||
v-if="$router.resolve('/' + item.name).route.name !== '404'"
|
||||
:to="{ path: '/' + item.name + '?' + item.param + '=' + (item.value ? resource[item.value] : item.param === 'account' ? resource.name + '&domainid=' + resource.domainid : resource.id) }">
|
||||
:to="{ path: '/' + item.name + '?' + item.param + '=' + (item.value ? resource[item.value] : item.param === 'account' ? resource.name + '&domainid=' + resource.domainid : item.param === 'keypair' ? resource.name : resource.id) }">
|
||||
<a-button style="margin-right: 10px" :icon="$router.resolve('/' + item.name).route.meta.icon" >
|
||||
{{ $t('label.view') + ' ' + $t(item.title) }}
|
||||
</a-button>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user