public class ListGrantsRequest extends AmazonWebServiceRequest implements java.io.Serializable
Gets a list of all grants for the specified customer master key (CMK).
You must specify the CMK in all requests. You can filter the grant list by grant ID or grantee principal.
The GranteePrincipal
field in the ListGrants
response usually contains the user or role designated as the grantee
principal in the grant. However, when the grantee principal in the grant is
an AWS service, the GranteePrincipal
field contains the service principal, which might represent several different grantee
principals.
Cross-account use: Yes. To perform this operation on a CMK in a
different AWS account, specify the key ARN in the value of the
KeyId
parameter.
Required permissions: kms:ListGrants (key policy)
Related operations:
Constructor and Description |
---|
ListGrantsRequest() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getGranteePrincipal()
Returns only grants where the specified principal is the grantee
principal for the grant.
|
java.lang.String |
getGrantId()
Returns only the grant with the specified grant ID.
|
java.lang.String |
getKeyId()
Returns only grants for the specified customer master key (CMK).
|
java.lang.Integer |
getLimit()
Use this parameter to specify the maximum number of items to return.
|
java.lang.String |
getMarker()
Use this parameter in a subsequent request after you receive a response
with truncated results.
|
int |
hashCode() |
void |
setGranteePrincipal(java.lang.String granteePrincipal)
Returns only grants where the specified principal is the grantee
principal for the grant.
|
void |
setGrantId(java.lang.String grantId)
Returns only the grant with the specified grant ID.
|
void |
setKeyId(java.lang.String keyId)
Returns only grants for the specified customer master key (CMK).
|
void |
setLimit(java.lang.Integer limit)
Use this parameter to specify the maximum number of items to return.
|
void |
setMarker(java.lang.String marker)
Use this parameter in a subsequent request after you receive a response
with truncated results.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
ListGrantsRequest |
withGranteePrincipal(java.lang.String granteePrincipal)
Returns only grants where the specified principal is the grantee
principal for the grant.
|
ListGrantsRequest |
withGrantId(java.lang.String grantId)
Returns only the grant with the specified grant ID.
|
ListGrantsRequest |
withKeyId(java.lang.String keyId)
Returns only grants for the specified customer master key (CMK).
|
ListGrantsRequest |
withLimit(java.lang.Integer limit)
Use this parameter to specify the maximum number of items to return.
|
ListGrantsRequest |
withMarker(java.lang.String marker)
Use this parameter in a subsequent request after you receive a response
with truncated results.
|
clone, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public java.lang.Integer getLimit()
Use this parameter to specify the maximum number of items to return. When this value is present, AWS KMS does not return more than the specified number of items, but it might return fewer.
This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.
Constraints:
Range: 1 - 1000
Use this parameter to specify the maximum number of items to return. When this value is present, AWS KMS does not return more than the specified number of items, but it might return fewer.
This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.
public void setLimit(java.lang.Integer limit)
Use this parameter to specify the maximum number of items to return. When this value is present, AWS KMS does not return more than the specified number of items, but it might return fewer.
This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.
Constraints:
Range: 1 - 1000
limit
- Use this parameter to specify the maximum number of items to return. When this value is present, AWS KMS does not return more than the specified number of items, but it might return fewer.
This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.
public ListGrantsRequest withLimit(java.lang.Integer limit)
Use this parameter to specify the maximum number of items to return. When this value is present, AWS KMS does not return more than the specified number of items, but it might return fewer.
This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Range: 1 - 1000
limit
- Use this parameter to specify the maximum number of items to return. When this value is present, AWS KMS does not return more than the specified number of items, but it might return fewer.
This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.
public java.lang.String getMarker()
Use this parameter in a subsequent request after you receive a response
with truncated results. Set it to the value of NextMarker
from the truncated response you just received.
Constraints:
Length: 1 - 1024
Pattern: [ -ÿ]*
Use this parameter in a subsequent request after you receive a
response with truncated results. Set it to the value of
NextMarker
from the truncated response you just
received.
public void setMarker(java.lang.String marker)
Use this parameter in a subsequent request after you receive a response
with truncated results. Set it to the value of NextMarker
from the truncated response you just received.
Constraints:
Length: 1 - 1024
Pattern: [ -ÿ]*
marker
-
Use this parameter in a subsequent request after you receive a
response with truncated results. Set it to the value of
NextMarker
from the truncated response you just
received.
public ListGrantsRequest withMarker(java.lang.String marker)
Use this parameter in a subsequent request after you receive a response
with truncated results. Set it to the value of NextMarker
from the truncated response you just received.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 1024
Pattern: [ -ÿ]*
marker
-
Use this parameter in a subsequent request after you receive a
response with truncated results. Set it to the value of
NextMarker
from the truncated response you just
received.
public java.lang.String getKeyId()
Returns only grants for the specified customer master key (CMK). This parameter is required.
Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN.
For example:
Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
Constraints:
Length: 1 - 2048
Returns only grants for the specified customer master key (CMK). This parameter is required.
Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN.
For example:
Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
public void setKeyId(java.lang.String keyId)
Returns only grants for the specified customer master key (CMK). This parameter is required.
Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN.
For example:
Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
Constraints:
Length: 1 - 2048
keyId
- Returns only grants for the specified customer master key (CMK). This parameter is required.
Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN.
For example:
Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
public ListGrantsRequest withKeyId(java.lang.String keyId)
Returns only grants for the specified customer master key (CMK). This parameter is required.
Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN.
For example:
Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 2048
keyId
- Returns only grants for the specified customer master key (CMK). This parameter is required.
Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN.
For example:
Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
public java.lang.String getGrantId()
Returns only the grant with the specified grant ID. The grant ID uniquely identifies the grant.
Constraints:
Length: 1 - 128
Returns only the grant with the specified grant ID. The grant ID uniquely identifies the grant.
public void setGrantId(java.lang.String grantId)
Returns only the grant with the specified grant ID. The grant ID uniquely identifies the grant.
Constraints:
Length: 1 - 128
grantId
- Returns only the grant with the specified grant ID. The grant ID uniquely identifies the grant.
public ListGrantsRequest withGrantId(java.lang.String grantId)
Returns only the grant with the specified grant ID. The grant ID uniquely identifies the grant.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 128
grantId
- Returns only the grant with the specified grant ID. The grant ID uniquely identifies the grant.
public java.lang.String getGranteePrincipal()
Returns only grants where the specified principal is the grantee principal for the grant.
Constraints:
Length: 1 - 256
Pattern: ^[\w+=,.@:/-]+$
Returns only grants where the specified principal is the grantee principal for the grant.
public void setGranteePrincipal(java.lang.String granteePrincipal)
Returns only grants where the specified principal is the grantee principal for the grant.
Constraints:
Length: 1 - 256
Pattern: ^[\w+=,.@:/-]+$
granteePrincipal
- Returns only grants where the specified principal is the grantee principal for the grant.
public ListGrantsRequest withGranteePrincipal(java.lang.String granteePrincipal)
Returns only grants where the specified principal is the grantee principal for the grant.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 256
Pattern: ^[\w+=,.@:/-]+$
granteePrincipal
- Returns only grants where the specified principal is the grantee principal for the grant.
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.