%% WARNING: DO NOT EDIT, AUTO-GENERATED CODE! %% See https://github.com/aws-beam/aws-codegen for more details. %% @doc Use Amazon CloudWatch Observability Access Manager to create and %% manage links between source accounts and monitoring accounts by using %% CloudWatch cross-account observability. %% %% With CloudWatch cross-account observability, you can monitor and %% troubleshoot applications that span multiple accounts within a Region. %% Seamlessly search, visualize, and analyze your metrics, logs, traces, and %% Application Insights applications in any of the linked accounts without %% account boundaries. %% %% Set up one or more Amazon Web Services accounts as monitoring accounts and %% link them with multiple source accounts. A monitoring account is a central %% Amazon Web Services account that can view and interact with observability %% data generated from source accounts. A source account is an individual %% Amazon Web Services account that generates observability data for the %% resources that reside in it. Source accounts share their observability %% data with the monitoring account. The shared observability data can %% include metrics in Amazon CloudWatch, logs in Amazon CloudWatch Logs, %% traces in X-Ray, and applications in Amazon CloudWatch Application %% Insights. -module(aws_oam). -export([create_link/2, create_link/3, create_sink/2, create_sink/3, delete_link/2, delete_link/3, delete_sink/2, delete_sink/3, get_link/2, get_link/3, get_sink/2, get_sink/3, get_sink_policy/2, get_sink_policy/3, list_attached_links/2, list_attached_links/3, list_links/2, list_links/3, list_sinks/2, list_sinks/3, list_tags_for_resource/2, list_tags_for_resource/4, list_tags_for_resource/5, put_sink_policy/2, put_sink_policy/3, tag_resource/3, tag_resource/4, untag_resource/3, untag_resource/4, update_link/2, update_link/3]). -include_lib("hackney/include/hackney_lib.hrl"). %%==================================================================== %% API %%==================================================================== %% @doc Creates a link between a source account and a sink that you have %% created in a monitoring account. %% %% Before you create a link, you must create a sink in the monitoring account %% and create a sink policy in that account. The sink policy must permit the %% source account to link to it. You can grant permission to source accounts %% by granting permission to an entire organization or to individual %% accounts. %% %% For more information, see CreateSink: %% https://docs.aws.amazon.com/OAM/latest/APIReference/API_CreateSink.html %% and PutSinkPolicy: %% https://docs.aws.amazon.com/OAM/latest/APIReference/API_PutSinkPolicy.html. %% %% Each monitoring account can be linked to as many as 100,000 source %% accounts. %% %% Each source account can be linked to as many as five monitoring accounts. create_link(Client, Input) -> create_link(Client, Input, []). create_link(Client, Input0, Options0) -> Method = post, Path = ["/CreateLink"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Use this to create a sink in the current account, so that it can be %% used as a monitoring account in CloudWatch cross-account observability. %% %% A sink is a resource that represents an attachment point in a monitoring %% account. Source accounts can link to the sink to send observability data. %% %% After you create a sink, you must create a sink policy that allows source %% accounts to attach to it. For more information, see PutSinkPolicy: %% https://docs.aws.amazon.com/OAM/latest/APIReference/API_PutSinkPolicy.html. %% %% Each account can contain one sink. If you delete a sink, you can then %% create a new one in that account. create_sink(Client, Input) -> create_sink(Client, Input, []). create_sink(Client, Input0, Options0) -> Method = post, Path = ["/CreateSink"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Deletes a link between a monitoring account sink and a source %% account. %% %% You must run this operation in the source account. delete_link(Client, Input) -> delete_link(Client, Input, []). delete_link(Client, Input0, Options0) -> Method = post, Path = ["/DeleteLink"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Deletes a sink. %% %% You must delete all links to a sink before you can delete that sink. delete_sink(Client, Input) -> delete_sink(Client, Input, []). delete_sink(Client, Input0, Options0) -> Method = post, Path = ["/DeleteSink"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Returns complete information about one link. %% %% To use this operation, provide the link ARN. To retrieve a list of link %% ARNs, use ListLinks: %% https://docs.aws.amazon.com/OAM/latest/APIReference/API_ListLinks.html. get_link(Client, Input) -> get_link(Client, Input, []). get_link(Client, Input0, Options0) -> Method = post, Path = ["/GetLink"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Returns complete information about one monitoring account sink. %% %% To use this operation, provide the sink ARN. To retrieve a list of sink %% ARNs, use ListSinks: %% https://docs.aws.amazon.com/OAM/latest/APIReference/API_ListSinks.html. get_sink(Client, Input) -> get_sink(Client, Input, []). get_sink(Client, Input0, Options0) -> Method = post, Path = ["/GetSink"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Returns the current sink policy attached to this sink. %% %% The sink policy specifies what accounts can attach to this sink as source %% accounts, and what types of data they can share. get_sink_policy(Client, Input) -> get_sink_policy(Client, Input, []). get_sink_policy(Client, Input0, Options0) -> Method = post, Path = ["/GetSinkPolicy"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Returns a list of source account links that are linked to this %% monitoring account sink. %% %% To use this operation, provide the sink ARN. To retrieve a list of sink %% ARNs, use ListSinks: %% https://docs.aws.amazon.com/OAM/latest/APIReference/API_ListSinks.html. %% %% To find a list of links for one source account, use ListLinks: %% https://docs.aws.amazon.com/OAM/latest/APIReference/API_ListLinks.html. list_attached_links(Client, Input) -> list_attached_links(Client, Input, []). list_attached_links(Client, Input0, Options0) -> Method = post, Path = ["/ListAttachedLinks"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Use this operation in a source account to return a list of links to %% monitoring account sinks that this source account has. %% %% To find a list of links for one monitoring account sink, use %% ListAttachedLinks: %% https://docs.aws.amazon.com/OAM/latest/APIReference/API_ListAttachedLinks.html %% from within the monitoring account. list_links(Client, Input) -> list_links(Client, Input, []). list_links(Client, Input0, Options0) -> Method = post, Path = ["/ListLinks"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Use this operation in a monitoring account to return the list of %% sinks created in that account. list_sinks(Client, Input) -> list_sinks(Client, Input, []). list_sinks(Client, Input0, Options0) -> Method = post, Path = ["/ListSinks"], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false}, {append_sha256_content_hash, false} | Options0], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Displays the tags associated with a resource. %% %% Both sinks and links support tagging. list_tags_for_resource(Client, ResourceArn) when is_map(Client) -> list_tags_for_resource(Client, ResourceArn, #{}, #{}). list_tags_for_resource(Client, ResourceArn, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> list_tags_for_resource(Client, ResourceArn, QueryMap, HeadersMap, []). list_tags_for_resource(Client, ResourceArn, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/tags/", aws_util:encode_uri(ResourceArn), ""], SuccessStatusCode = 200, Options = [{send_body_as_binary, false}, {receive_body_as_binary, false} | Options0], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Creates or updates the resource policy that grants permissions to %% source accounts to link to the monitoring account sink. %% %% When you create a sink policy, you can grant permissions to all accounts %% in an organization or to individual accounts. %% %% You can also use a sink policy to limit the types of data that is shared. %% The three types that you can allow or deny are: %% %%