ExAws.RedShift v0.1.0 ExAws.RedShift View Source
Operations on AWS RedShift.
Link to this section Summary
Functions
Create a new cluster with the given cluster id
Delete a RedShift cluster with the a given identifier
Describe the properties of the given cluster ID. If no cluster ID is given, a list of properties for all clusters is returned
A function for expanding a list of values for enumerable keys
Modify a cluster with a given ClusterIdentifier
Link to this section Types
create_cluster_opts() :: [cluster_identifier: binary(), master_username: binary(), master_user_password: binary(), node_type: node_type(), allow_version_upgrade: boolean(), automated_snapshot_retention_period: 0..35, availability_zone: binary(), cluster_parameter_group_name: binary(), cluster_security_groups: [binary()], cluster_subnet_group_name: binary(), cluster_type: cluster_type(), cluster_version: binary(), db_name: binary(), elastic_ip: binary(), encrypted: boolean(), enhanced_vpc_routing: :boolean, hsm_client_certificate_identifier: binary(), hsm_configuration_identifier: binary(), iam_roles: [binary()]]
delete_cluster_opts() :: [cluster_identifier: binary(), final_cluster_snapshot_identifier: binary(), skip_final_cluster_snapshot: boolean()]
describe_clusters_opts() :: [cluster_identifier: binary(), marker: binary(), max_records: 20..100, tag_keys: binary(), tag_values: binary()]
modify_cluster_opts() :: [cluster_identifier: binary(), additional_info: binary(), allow_version_upgrade: boolean(), automated_snapshot_retention_period: 0..35, cluster_parameter_group_name: binary(), cluster_security_groups: [binary()], cluster_type: cluster_type(), cluster_version: binary(), elastic_ip: binary(), enhanced_vpc_routing: boolean(), hsm_client_certificate_identifier: binary(), hsm_onfiguration_identifier: binary(), master_user_password: binary(), new_cluster_identifier: binary(), node_type: node_type(), number_of_nodes: integer(), preferred_maintenance_window: binary(), publicly_accessible: boolean(), vpc_security_groups: [binary()]]
node_type() :: [:"ds1.xlarge" | :"ds1.8xlarge" | :"ds2.xlarge" | :"ds2.8xlarge" | :"dc1.large" | :"dc1.8xlarge"]
Link to this section Functions
create_cluster(create_cluster_opts()) :: ExAws.Operation.Query.t()
Create a new cluster with the given cluster id.
Required keys are cluster_identifier, master_username, master_user_password, and node_type.
Amazon docs: http://docs.aws.amazon.com/redshift/latest/APIReference/API_CreateCluster.html
Examples
iex> ExAws.RedShift.create_cluster("A2", [master_username: "Nier", master_user_password: "Automata", node_type: "dc1_large"])
%ExAws.Operation.Query{action: "CreateCluster",
params: %{"Action" => "CreateCluster", "ClusterIdentifier" => "A2", "MasterUsername" => "Nier", "MasterUserPassword" => "Automata", "NodeType" => "dc1_large"},
parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
iex> ExAws.RedShift.create_cluster("A2", [cluster_identifier: "21O", master_username: "Nier", master_user_password: "Automata", node_type: "dc1_large"])
%ExAws.Operation.Query{action: "CreateCluster",
params: %{"Action" => "CreateCluster", "ClusterIdentifier" => "A2", "MasterUsername" => "Nier", "MasterUserPassword" => "Automata", "NodeType" => "dc1_large"},
parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
iex> ExAws.RedShift.create_cluster([cluster_identifier: "2B", master_username: "Nier", master_user_password: "Automata", node_type: "dc1_large"])
%ExAws.Operation.Query{action: "CreateCluster",
params: %{"Action" => "CreateCluster", "ClusterIdentifier" => "2B", "MasterUsername" => "Nier", "MasterUserPassword" => "Automata", "NodeType" => "dc1_large"},
parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
create_cluster(String.t(), create_cluster_opts()) :: ExAws.Operation.Query.t()
delete_cluster(Keyword.t()) :: ExAws.Operation.Query.t()
Delete a RedShift cluster with the a given identifier.
Required key is cluster_identifier.
Amazon docs: http://docs.aws.amazon.com/redshift/latest/APIReference/API_DeleteCluster.html
Examples
iex> ExAws.RedShift.delete_cluster("2B", [])
%ExAws.Operation.Query{action: "DeleteCluster",
params: %{"Action" => "DeleteCluster", "ClusterIdentifier" => "2B"},
parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
delete_cluster(String.t(), delete_cluster_opts()) :: ExAws.Operation.Query.t()
describe_clusters(describe_clusters_opts()) :: ExAws.Operation.Query.t()
Describe the properties of the given cluster ID. If no cluster ID is given, a list of properties for all clusters is returned.
Amazon docs: http://docs.aws.amazon.com/redshift/latest/APIReference/API_DescribeClusters.html
Examples
iex> ExAws.RedShift.describe_clusters([cluster_identifier: "2B"])
%ExAws.Operation.Query{action: "DescribeClusters",
params: %{"Action" => "DescribeClusters", "ClusterIdentifier" => "2B"},
parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
iex> ExAws.RedShift.describe_clusters([cluster_identifier: "2B", some_wrong_key: "Eve"])
%ExAws.Operation.Query{action: "DescribeClusters",
params: %{"Action" => "DescribeClusters", "ClusterIdentifier" => "2B"},
parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
iex> ExAws.RedShift.describe_clusters("A2", [])
%ExAws.Operation.Query{action: "DescribeClusters",
params: %{"Action" => "DescribeClusters", "ClusterIdentifier" => "A2"},
parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
iex> ExAws.RedShift.describe_clusters("9S", [cluster_identifier: "21O"])
%ExAws.Operation.Query{action: "DescribeClusters",
params: %{"Action" => "DescribeClusters", "ClusterIdentifier" => "9S"},
parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
describe_clusters(String.t(), describe_clusters_opts()) :: ExAws.Operation.Query.t()
A function for expanding a list of values for enumerable keys.
Some AWS keys support multiple values like roles, security groups, or tags.
The key usually follows the format Names.Name.<index>, for example,
IamRoles.IamRoleArn.1 as seen in the examples below. The function takes
the key and a list of values, then append numerical index to the key using
the given separator and pair it with each value.
Examples
iex> ExAws.RedShift.expand_params({"iam_roles/_iam_role_arn", ["Operator", "Scanner"]})
[{"iam_roles/_iam_role_arn/1", "Operator"}, {"iam_roles/_iam_role_arn/2", "Scanner"}]
iex> ExAws.RedShift.expand_params({"IamRoles.IamRoleArn", ["Operator", "Scanner"]}, ".")
[{"IamRoles.IamRoleArn.1", "Operator"}, {"IamRoles.IamRoleArn.2", "Scanner"}]
iex> ExAws.RedShift.expand_params({"iam_roles/_iam_role_arn", []})
[]
modify_cluster(Keyword.t()) :: ExAws.Operation.Query.t()
Modify a cluster with a given ClusterIdentifier.
Required key is cluster_identifier.
Amazon docs: http://docs.aws.amazon.com/redshift/latest/APIReference/API_ModifyCluster.html
Examples
iex> ExAws.RedShift.modify_cluster("Adam", [])
%ExAws.Operation.Query{action: "ModifyCluster",
params: %{"Action" => "ModifyCluster", "ClusterIdentifier" => "Adam"},
parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
iex> ExAws.RedShift.modify_cluster("Adam", [new_cluster_identifier: "Eve"])
%ExAws.Operation.Query{action: "ModifyCluster",
params: %{"Action" => "ModifyCluster", "ClusterIdentifier" => "Adam", "NewClusterIdentifier" => "Eve"},
parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
iex> ExAws.RedShift.modify_cluster("Adam", [cluster_identifier: "Eve", cluster_security_groups: ["test", "tast"]])
%ExAws.Operation.Query{action: "ModifyCluster",
params: %{"Action" => "ModifyCluster", "ClusterIdentifier" => "Adam", "ClusterSecurityGroups.ClusterSecurityGroupName.1" => "test", "ClusterSecurityGroups.ClusterSecurityGroupName.2" => "tast"},
parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
modify_cluster(String.t(), Keyword.t()) :: ExAws.Operation.Query.t()