Struct aws_sdk_grafana::Client
source · [−]pub struct Client { /* private fields */ }
Expand description
Client for Amazon Managed Grafana
Client for invoking operations on Amazon Managed Grafana. Each operation on Amazon Managed Grafana is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
Examples
Constructing a client and invoking an operation
// create a shared configuration. This can be used & shared between multiple service clients.
let shared_config = aws_config::load_from_env().await;
let client = aws_sdk_grafana::Client::new(&shared_config);
// invoke an operation
/* let rsp = client
.<operation_name>().
.<param>("some value")
.send().await; */
Constructing a client with custom configuration
use aws_config::RetryConfig;
let shared_config = aws_config::load_from_env().await;
let config = aws_sdk_grafana::config::Builder::from(&shared_config)
.retry_config(RetryConfig::disabled())
.build();
let client = aws_sdk_grafana::Client::from_conf(config);
Implementations
sourceimpl Client
impl Client
sourcepub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
pub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
Creates a client with the given service configuration.
sourceimpl Client
impl Client
sourcepub fn associate_license(&self) -> AssociateLicense
pub fn associate_license(&self) -> AssociateLicense
Constructs a fluent builder for the AssociateLicense
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:The ID of the workspace to associate the license with.
license_type(LicenseType)
/set_license_type(Option<LicenseType>)
:The type of license to associate with the workspace.
- On success, responds with
AssociateLicenseOutput
with field(s):workspace(Option<WorkspaceDescription>)
:A structure containing data about the workspace.
- On failure, responds with
SdkError<AssociateLicenseError>
sourcepub fn create_workspace(&self) -> CreateWorkspace
pub fn create_workspace(&self) -> CreateWorkspace
Constructs a fluent builder for the CreateWorkspace
operation.
- The fluent builder is configurable:
account_access_type(AccountAccessType)
/set_account_access_type(Option<AccountAccessType>)
:Specifies whether the workspace can access Amazon Web Services resources in this Amazon Web Services account only, or whether it can also access Amazon Web Services resources in other accounts in the same organization. If you specify
ORGANIZATION
, you must specify which organizational units the workspace can access in theworkspaceOrganizationalUnits
parameter.client_token(impl Into<String>)
/set_client_token(Option<String>)
:A unique, case-sensitive, user-provided identifier to ensure the idempotency of the request.
organization_role_name(impl Into<String>)
/set_organization_role_name(Option<String>)
:The name of an IAM role that already exists to use with Organizations to access Amazon Web Services data sources and notification channels in other accounts in an organization.
permission_type(PermissionType)
/set_permission_type(Option<PermissionType>)
:If you specify
SERVICE_MANAGED
on AWS Grafana console, Amazon Managed Grafana automatically creates the IAM roles and provisions the permissions that the workspace needs to use Amazon Web Services data sources and notification channels. In CLI mode, the permissionTypeSERVICE_MANAGED
will not create the IAM role for you.If you specify
CUSTOMER_MANAGED
, you will manage those roles and permissions yourself. If you are creating this workspace in a member account of an organization that is not a delegated administrator account, and you want the workspace to access data sources in other Amazon Web Services accounts in the organization, you must chooseCUSTOMER_MANAGED
.For more information, see Amazon Managed Grafana permissions and policies for Amazon Web Services data sources and notification channels.
stack_set_name(impl Into<String>)
/set_stack_set_name(Option<String>)
:The name of the CloudFormation stack set to use to generate IAM roles to be used for this workspace.
workspace_data_sources(Vec<DataSourceType>)
/set_workspace_data_sources(Option<Vec<DataSourceType>>)
:Specify the Amazon Web Services data sources that you want to be queried in this workspace. Specifying these data sources here enables Amazon Managed Grafana to create IAM roles and permissions that allow Amazon Managed Grafana to read data from these sources. You must still add them as data sources in the Grafana console in the workspace.
If you don’t specify a data source here, you can still add it as a data source in the workspace console later. However, you will then have to manually configure permissions for it.
workspace_description(impl Into<String>)
/set_workspace_description(Option<String>)
:A description for the workspace. This is used only to help you identify this workspace.
Pattern:
^[\p{L}\p{Z}\p{N}\p{P}]{0,2048}$
workspace_name(impl Into<String>)
/set_workspace_name(Option<String>)
:The name for the workspace. It does not have to be unique.
workspace_notification_destinations(Vec<NotificationDestinationType>)
/set_workspace_notification_destinations(Option<Vec<NotificationDestinationType>>)
:Specify the Amazon Web Services notification channels that you plan to use in this workspace. Specifying these data sources here enables Amazon Managed Grafana to create IAM roles and permissions that allow Amazon Managed Grafana to use these channels.
workspace_organizational_units(Vec<String>)
/set_workspace_organizational_units(Option<Vec<String>>)
:Specifies the organizational units that this workspace is allowed to use data sources from, if this workspace is in an account that is part of an organization.
workspace_role_arn(impl Into<String>)
/set_workspace_role_arn(Option<String>)
:The workspace needs an IAM role that grants permissions to the Amazon Web Services resources that the workspace will view data from. If you already have a role that you want to use, specify it here. The permission type should be set to
CUSTOMER_MANAGED
.authentication_providers(Vec<AuthenticationProviderTypes>)
/set_authentication_providers(Option<Vec<AuthenticationProviderTypes>>)
:Specifies whether this workspace uses SAML 2.0, Amazon Web Services Single Sign On, or both to authenticate users for using the Grafana console within a workspace. For more information, see User authentication in Amazon Managed Grafana.
tags(HashMap<String, String>)
/set_tags(Option<HashMap<String, String>>)
:The list of tags associated with the workspace.
- On success, responds with
CreateWorkspaceOutput
with field(s):workspace(Option<WorkspaceDescription>)
:A structure containing data about the workspace that was created.
- On failure, responds with
SdkError<CreateWorkspaceError>
sourcepub fn create_workspace_api_key(&self) -> CreateWorkspaceApiKey
pub fn create_workspace_api_key(&self) -> CreateWorkspaceApiKey
Constructs a fluent builder for the CreateWorkspaceApiKey
operation.
- The fluent builder is configurable:
key_name(impl Into<String>)
/set_key_name(Option<String>)
:Specifies the name of the key to create. Key names must be unique to the workspace.
key_role(impl Into<String>)
/set_key_role(Option<String>)
:Specifies the permission level of the key.
Valid Values:
VIEWER
|EDITOR
|ADMIN
seconds_to_live(i32)
/set_seconds_to_live(Option<i32>)
:Specifies the time in seconds until the key expires. Keys can be valid for up to 30 days.
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:The ID of the workspace in which to create an API key.
- On success, responds with
CreateWorkspaceApiKeyOutput
with field(s):key_name(Option<String>)
:The name of the key that was created.
key(Option<String>)
:The key token that was created. Use this value as a bearer token to authenticate HTTP requests to the workspace.
workspace_id(Option<String>)
:The ID of the workspace that the key is valid for.
- On failure, responds with
SdkError<CreateWorkspaceApiKeyError>
sourcepub fn delete_workspace(&self) -> DeleteWorkspace
pub fn delete_workspace(&self) -> DeleteWorkspace
Constructs a fluent builder for the DeleteWorkspace
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:The ID of the workspace to delete.
- On success, responds with
DeleteWorkspaceOutput
with field(s):workspace(Option<WorkspaceDescription>)
:A structure containing information about the workspace that was deleted.
- On failure, responds with
SdkError<DeleteWorkspaceError>
sourcepub fn delete_workspace_api_key(&self) -> DeleteWorkspaceApiKey
pub fn delete_workspace_api_key(&self) -> DeleteWorkspaceApiKey
Constructs a fluent builder for the DeleteWorkspaceApiKey
operation.
- The fluent builder is configurable:
key_name(impl Into<String>)
/set_key_name(Option<String>)
:The name of the API key to delete.
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:The ID of the workspace to delete.
- On success, responds with
DeleteWorkspaceApiKeyOutput
with field(s):key_name(Option<String>)
:The name of the API key that was deleted.
workspace_id(Option<String>)
:The ID of the workspace where the key was deleted.
- On failure, responds with
SdkError<DeleteWorkspaceApiKeyError>
sourcepub fn describe_workspace(&self) -> DescribeWorkspace
pub fn describe_workspace(&self) -> DescribeWorkspace
Constructs a fluent builder for the DescribeWorkspace
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:The ID of the workspace to display information about.
- On success, responds with
DescribeWorkspaceOutput
with field(s):workspace(Option<WorkspaceDescription>)
:A structure containing information about the workspace.
- On failure, responds with
SdkError<DescribeWorkspaceError>
sourcepub fn describe_workspace_authentication(
&self
) -> DescribeWorkspaceAuthentication
pub fn describe_workspace_authentication(
&self
) -> DescribeWorkspaceAuthentication
Constructs a fluent builder for the DescribeWorkspaceAuthentication
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:The ID of the workspace to return authentication information about.
- On success, responds with
DescribeWorkspaceAuthenticationOutput
with field(s):authentication(Option<AuthenticationDescription>)
:A structure containing information about the authentication methods used in the workspace.
- On failure, responds with
SdkError<DescribeWorkspaceAuthenticationError>
sourcepub fn disassociate_license(&self) -> DisassociateLicense
pub fn disassociate_license(&self) -> DisassociateLicense
Constructs a fluent builder for the DisassociateLicense
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:The ID of the workspace to remove the Grafana Enterprise license from.
license_type(LicenseType)
/set_license_type(Option<LicenseType>)
:The type of license to remove from the workspace.
- On success, responds with
DisassociateLicenseOutput
with field(s):workspace(Option<WorkspaceDescription>)
:A structure containing information about the workspace.
- On failure, responds with
SdkError<DisassociateLicenseError>
sourcepub fn list_permissions(&self) -> ListPermissions
pub fn list_permissions(&self) -> ListPermissions
Constructs a fluent builder for the ListPermissions
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
max_results(i32)
/set_max_results(Option<i32>)
:The maximum number of results to include in the response.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token to use when requesting the next set of results. You received this token from a previous
ListPermissions
operation.user_type(UserType)
/set_user_type(Option<UserType>)
:(Optional) If you specify
SSO_USER
, then only the permissions of Amazon Web Services SSO users are returned. If you specifySSO_GROUP
, only the permissions of Amazon Web Services SSO groups are returned.user_id(impl Into<String>)
/set_user_id(Option<String>)
:(Optional) Limits the results to only the user that matches this ID.
group_id(impl Into<String>)
/set_group_id(Option<String>)
:(Optional) Limits the results to only the group that matches this ID.
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:The ID of the workspace to list permissions for. This parameter is required.
- On success, responds with
ListPermissionsOutput
with field(s):next_token(Option<String>)
:The token to use in a subsequent
ListPermissions
operation to return the next set of results.permissions(Option<Vec<PermissionEntry>>)
:The permissions returned by the operation.
- On failure, responds with
SdkError<ListPermissionsError>
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:The ARN of the resource the list of tags are associated with.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<HashMap<String, String>>)
:The list of tags that are associated with the resource.
- On failure, responds with
SdkError<ListTagsForResourceError>
sourcepub fn list_workspaces(&self) -> ListWorkspaces
pub fn list_workspaces(&self) -> ListWorkspaces
Constructs a fluent builder for the ListWorkspaces
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
max_results(i32)
/set_max_results(Option<i32>)
:The maximum number of workspaces to include in the results.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token for the next set of workspaces to return. (You receive this token from a previous
ListWorkspaces
operation.)
- On success, responds with
ListWorkspacesOutput
with field(s):workspaces(Option<Vec<WorkspaceSummary>>)
:An array of structures that contain some information about the workspaces in the account.
next_token(Option<String>)
:The token to use when requesting the next set of workspaces.
- On failure, responds with
SdkError<ListWorkspacesError>
sourcepub fn tag_resource(&self) -> TagResource
pub fn tag_resource(&self) -> TagResource
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:The ARN of the resource the tag is associated with.
tags(HashMap<String, String>)
/set_tags(Option<HashMap<String, String>>)
:The list of tag keys and values to associate with the resource. You can associate tag keys only, tags (key and values) only or a combination of tag keys and tags.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
sourcepub fn untag_resource(&self) -> UntagResource
pub fn untag_resource(&self) -> UntagResource
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:The ARN of the resource the tag association is removed from.
tag_keys(Vec<String>)
/set_tag_keys(Option<Vec<String>>)
:The key values of the tag to be removed from the resource.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
sourcepub fn update_permissions(&self) -> UpdatePermissions
pub fn update_permissions(&self) -> UpdatePermissions
Constructs a fluent builder for the UpdatePermissions
operation.
- The fluent builder is configurable:
update_instruction_batch(Vec<UpdateInstruction>)
/set_update_instruction_batch(Option<Vec<UpdateInstruction>>)
:An array of structures that contain the permission updates to make.
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:The ID of the workspace to update.
- On success, responds with
UpdatePermissionsOutput
with field(s):errors(Option<Vec<UpdateError>>)
:An array of structures that contain the errors from the operation, if any.
- On failure, responds with
SdkError<UpdatePermissionsError>
sourcepub fn update_workspace(&self) -> UpdateWorkspace
pub fn update_workspace(&self) -> UpdateWorkspace
Constructs a fluent builder for the UpdateWorkspace
operation.
- The fluent builder is configurable:
account_access_type(AccountAccessType)
/set_account_access_type(Option<AccountAccessType>)
:Specifies whether the workspace can access Amazon Web Services resources in this Amazon Web Services account only, or whether it can also access Amazon Web Services resources in other accounts in the same organization. If you specify
ORGANIZATION
, you must specify which organizational units the workspace can access in theworkspaceOrganizationalUnits
parameter.organization_role_name(impl Into<String>)
/set_organization_role_name(Option<String>)
:The name of an IAM role that already exists to use to access resources through Organizations.
permission_type(PermissionType)
/set_permission_type(Option<PermissionType>)
:If you specify
Service Managed
, Amazon Managed Grafana automatically creates the IAM roles and provisions the permissions that the workspace needs to use Amazon Web Services data sources and notification channels.If you specify
CUSTOMER_MANAGED
, you will manage those roles and permissions yourself. If you are creating this workspace in a member account of an organization and that account is not a delegated administrator account, and you want the workspace to access data sources in other Amazon Web Services accounts in the organization, you must chooseCUSTOMER_MANAGED
.For more information, see Amazon Managed Grafana permissions and policies for Amazon Web Services data sources and notification channels
stack_set_name(impl Into<String>)
/set_stack_set_name(Option<String>)
:The name of the CloudFormation stack set to use to generate IAM roles to be used for this workspace.
workspace_data_sources(Vec<DataSourceType>)
/set_workspace_data_sources(Option<Vec<DataSourceType>>)
:Specify the Amazon Web Services data sources that you want to be queried in this workspace. Specifying these data sources here enables Amazon Managed Grafana to create IAM roles and permissions that allow Amazon Managed Grafana to read data from these sources. You must still add them as data sources in the Grafana console in the workspace.
If you don’t specify a data source here, you can still add it as a data source later in the workspace console. However, you will then have to manually configure permissions for it.
workspace_description(impl Into<String>)
/set_workspace_description(Option<String>)
:A description for the workspace. This is used only to help you identify this workspace.
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:The ID of the workspace to update.
workspace_name(impl Into<String>)
/set_workspace_name(Option<String>)
:A new name for the workspace to update.
workspace_notification_destinations(Vec<NotificationDestinationType>)
/set_workspace_notification_destinations(Option<Vec<NotificationDestinationType>>)
:Specify the Amazon Web Services notification channels that you plan to use in this workspace. Specifying these data sources here enables Amazon Managed Grafana to create IAM roles and permissions that allow Amazon Managed Grafana to use these channels.
workspace_organizational_units(Vec<String>)
/set_workspace_organizational_units(Option<Vec<String>>)
:Specifies the organizational units that this workspace is allowed to use data sources from, if this workspace is in an account that is part of an organization.
workspace_role_arn(impl Into<String>)
/set_workspace_role_arn(Option<String>)
:The workspace needs an IAM role that grants permissions to the Amazon Web Services resources that the workspace will view data from. If you already have a role that you want to use, specify it here. If you omit this field and you specify some Amazon Web Services resources in
workspaceDataSources
orworkspaceNotificationDestinations
, a new IAM role with the necessary permissions is automatically created.
- On success, responds with
UpdateWorkspaceOutput
with field(s):workspace(Option<WorkspaceDescription>)
:A structure containing data about the workspace that was created.
- On failure, responds with
SdkError<UpdateWorkspaceError>
sourcepub fn update_workspace_authentication(&self) -> UpdateWorkspaceAuthentication
pub fn update_workspace_authentication(&self) -> UpdateWorkspaceAuthentication
Constructs a fluent builder for the UpdateWorkspaceAuthentication
operation.
- The fluent builder is configurable:
workspace_id(impl Into<String>)
/set_workspace_id(Option<String>)
:The ID of the workspace to update the authentication for.
authentication_providers(Vec<AuthenticationProviderTypes>)
/set_authentication_providers(Option<Vec<AuthenticationProviderTypes>>)
:Specifies whether this workspace uses SAML 2.0, Amazon Web Services Single Sign On, or both to authenticate users for using the Grafana console within a workspace. For more information, see User authentication in Amazon Managed Grafana.
saml_configuration(SamlConfiguration)
/set_saml_configuration(Option<SamlConfiguration>)
:If the workspace uses SAML, use this structure to map SAML assertion attributes to workspace user information and define which groups in the assertion attribute are to have the
Admin
andEditor
roles in the workspace.
- On success, responds with
UpdateWorkspaceAuthenticationOutput
with field(s):authentication(Option<AuthenticationDescription>)
:A structure that describes the user authentication for this workspace after the update is made.
- On failure, responds with
SdkError<UpdateWorkspaceAuthenticationError>
sourceimpl Client
impl Client
sourcepub fn from_conf_conn<C, E>(conf: Config, conn: C) -> Self where
C: SmithyConnector<Error = E> + Send + 'static,
E: Into<ConnectorError>,
pub fn from_conf_conn<C, E>(conf: Config, conn: C) -> Self where
C: SmithyConnector<Error = E> + Send + 'static,
E: Into<ConnectorError>,
Creates a client with the given service config and connector override.
Trait Implementations
sourceimpl From<Client<DynConnector, DynMiddleware<DynConnector>, Standard>> for Client
impl From<Client<DynConnector, DynMiddleware<DynConnector>, Standard>> for Client
sourcefn from(client: Client<DynConnector, DynMiddleware<DynConnector>>) -> Self
fn from(client: Client<DynConnector, DynMiddleware<DynConnector>>) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more