setVisibleToAllUsers method
Sets the Cluster$VisibleToAllUsers value, which determines whether
the cluster is visible to all IAM users of the AWS account associated with
the cluster. Only the IAM user who created the cluster or the AWS account
root user can call this action. The default value, true
,
indicates that all IAM users in the AWS account can perform cluster
actions if they have the proper IAM policy permissions. If set to
false
, only the IAM user that created the cluster can perform
actions. This action works on running clusters. You can override the
default true
setting when you create a cluster by using the
VisibleToAllUsers
parameter with RunJobFlow
.
May throw InternalServerError.
Parameter jobFlowIds
:
The unique identifier of the job flow (cluster).
Parameter visibleToAllUsers
:
A value of true
indicates that all IAM users in the AWS
account can perform cluster actions if they have the proper IAM policy
permissions. This is the default. A value of false
indicates
that only the IAM user who created the cluster can perform actions.
Implementation
Future<void> setVisibleToAllUsers({
required List<String> jobFlowIds,
required bool visibleToAllUsers,
}) async {
ArgumentError.checkNotNull(jobFlowIds, 'jobFlowIds');
ArgumentError.checkNotNull(visibleToAllUsers, 'visibleToAllUsers');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'ElasticMapReduce.SetVisibleToAllUsers'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'JobFlowIds': jobFlowIds,
'VisibleToAllUsers': visibleToAllUsers,
},
);
}