Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -50,6 +52,9 @@ public class ListSSHKeyPairsCmd extends BaseListProjectAndAccountResourcesCmd {
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
public Long getId() {
return id;
}

public String getName() {
return name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@
import org.apache.cloudstack.api.ApiConstants;

import com.cloud.serializer.Param;
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4152,6 +4152,7 @@ public boolean deleteSSHKeyPair(final DeleteSSHKeyPairCmd cmd) {

@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();
Expand All @@ -4171,6 +4172,10 @@ public Pair<List<? extends SSHKeyPair>, Integer> listSSHKeyPairs(final ListSSHKe
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);
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/view/InfoCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down