2019/11/25 - Amazon Redshift - 4 new 2 updated api methods
Changes This release contains changes for 1. Redshift Scheduler 2. Update to the DescribeNodeConfigurationOptions to include a new action type recommend-node-config
Deletes a scheduled action.
See also: AWS API Documentation
Request Syntax
client.delete_scheduled_action( ScheduledActionName='string' )
string
[REQUIRED]
The name of the scheduled action to delete.
None
Creates a scheduled action. A scheduled action contains a schedule and an Amazon Redshift API action. For example, you can create a schedule of when to run the ResizeCluster API operation.
See also: AWS API Documentation
Request Syntax
client.create_scheduled_action( ScheduledActionName='string', TargetAction={ 'ResizeCluster': { 'ClusterIdentifier': 'string', 'ClusterType': 'string', 'NodeType': 'string', 'NumberOfNodes': 123, 'Classic': True|False } }, Schedule='string', IamRole='string', ScheduledActionDescription='string', StartTime=datetime(2015, 1, 1), EndTime=datetime(2015, 1, 1), Enable=True|False )
string
[REQUIRED]
The name of the scheduled action. The name must be unique within an account. For more information about this parameter, see ScheduledAction .
dict
[REQUIRED]
A JSON format string of the Amazon Redshift API operation with input parameters. For more information about this parameter, see ScheduledAction .
ResizeCluster (dict) --
An action that runs a ResizeCluster API operation.
ClusterIdentifier (string) -- [REQUIRED]
The unique identifier for the cluster to resize.
ClusterType (string) --
The new cluster type for the specified cluster.
NodeType (string) --
The new node type for the nodes you are adding. If not specified, the cluster's current node type is used.
NumberOfNodes (integer) -- [REQUIRED]
The new number of nodes for the cluster.
Classic (boolean) --
A boolean value indicating whether the resize operation is using the classic resize process. If you don't provide this parameter or set the value to false , the resize type is elastic.
string
[REQUIRED]
The schedule in at( ) or cron( ) format. For more information about this parameter, see ScheduledAction .
string
[REQUIRED]
The IAM role to assume to run the target action. For more information about this parameter, see ScheduledAction .
string
The description of the scheduled action.
datetime
The start time in UTC of the scheduled action. Before this time, the scheduled action does not trigger. For more information about this parameter, see ScheduledAction .
datetime
The end time in UTC of the scheduled action. After this time, the scheduled action does not trigger. For more information about this parameter, see ScheduledAction .
boolean
If true, the schedule is enabled. If false, the scheduled action does not trigger. For more information about state of the scheduled action, see ScheduledAction .
dict
Response Syntax
{ 'ScheduledActionName': 'string', 'TargetAction': { 'ResizeCluster': { 'ClusterIdentifier': 'string', 'ClusterType': 'string', 'NodeType': 'string', 'NumberOfNodes': 123, 'Classic': True|False } }, 'Schedule': 'string', 'IamRole': 'string', 'ScheduledActionDescription': 'string', 'State': 'ACTIVE'|'DISABLED', 'NextInvocations': [ datetime(2015, 1, 1), ], 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1) }
Response Structure
(dict) --
Describes a scheduled action. You can use a scheduled action to trigger some Amazon Redshift API operations on a schedule. For information about which API operations can be scheduled, see ScheduledActionType .
ScheduledActionName (string) --
The name of the scheduled action.
TargetAction (dict) --
A JSON format string of the Amazon Redshift API operation with input parameters.
"{\"ResizeCluster\":{\"NodeType\":\"ds2.8xlarge\",\"ClusterIdentifier\":\"my-test-cluster\",\"NumberOfNodes\":3}} ".
ResizeCluster (dict) --
An action that runs a ResizeCluster API operation.
ClusterIdentifier (string) --
The unique identifier for the cluster to resize.
ClusterType (string) --
The new cluster type for the specified cluster.
NodeType (string) --
The new node type for the nodes you are adding. If not specified, the cluster's current node type is used.
NumberOfNodes (integer) --
The new number of nodes for the cluster.
Classic (boolean) --
A boolean value indicating whether the resize operation is using the classic resize process. If you don't provide this parameter or set the value to false , the resize type is elastic.
Schedule (string) --
The schedule for a one-time (at format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour.
Format of at expressions is "at(yyyy-mm-ddThh:mm:ss) ". For example, "at(2016-03-04T17:27:00) ".
Format of cron expressions is "cron(Minutes Hours Day-of-month Month Day-of-week Year) ". For example, "cron(0, 10, *, *, MON, *) ". For more information, see Cron Expressions in the Amazon CloudWatch Events User Guide .
IamRole (string) --
The IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler (Principal scheduler.redshift.amazonaws.com) to assume permissions on your behalf. For more information about the IAM role to use with the Amazon Redshift scheduler, see Using Identity-Based Policies for Amazon Redshift in the Amazon Redshift Cluster Management Guide .
ScheduledActionDescription (string) --
The description of the scheduled action.
State (string) --
The state of the scheduled action. For example, DISABLED .
NextInvocations (list) --
List of times when the scheduled action will run.
(datetime) --
StartTime (datetime) --
The start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger.
EndTime (datetime) --
The end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger.
Modify a scheduled action.
See also: AWS API Documentation
Request Syntax
client.modify_scheduled_action( ScheduledActionName='string', TargetAction={ 'ResizeCluster': { 'ClusterIdentifier': 'string', 'ClusterType': 'string', 'NodeType': 'string', 'NumberOfNodes': 123, 'Classic': True|False } }, Schedule='string', IamRole='string', ScheduledActionDescription='string', StartTime=datetime(2015, 1, 1), EndTime=datetime(2015, 1, 1), Enable=True|False )
string
[REQUIRED]
The name of the scheduled action to modify.
dict
A modified JSON format of the scheduled action. For more information about this parameter, see ScheduledAction .
ResizeCluster (dict) --
An action that runs a ResizeCluster API operation.
ClusterIdentifier (string) -- [REQUIRED]
The unique identifier for the cluster to resize.
ClusterType (string) --
The new cluster type for the specified cluster.
NodeType (string) --
The new node type for the nodes you are adding. If not specified, the cluster's current node type is used.
NumberOfNodes (integer) -- [REQUIRED]
The new number of nodes for the cluster.
Classic (boolean) --
A boolean value indicating whether the resize operation is using the classic resize process. If you don't provide this parameter or set the value to false , the resize type is elastic.
string
A modified schedule in either at( ) or cron( ) format. For more information about this parameter, see ScheduledAction .
string
A different IAM role to assume to run the target action. For more information about this parameter, see ScheduledAction .
string
A modified description of the scheduled action.
datetime
A modified start time of the scheduled action. For more information about this parameter, see ScheduledAction .
datetime
A modified end time of the scheduled action. For more information about this parameter, see ScheduledAction .
boolean
A modified enable flag of the scheduled action. If true, the scheduled action is active. If false, the scheduled action is disabled.
dict
Response Syntax
{ 'ScheduledActionName': 'string', 'TargetAction': { 'ResizeCluster': { 'ClusterIdentifier': 'string', 'ClusterType': 'string', 'NodeType': 'string', 'NumberOfNodes': 123, 'Classic': True|False } }, 'Schedule': 'string', 'IamRole': 'string', 'ScheduledActionDescription': 'string', 'State': 'ACTIVE'|'DISABLED', 'NextInvocations': [ datetime(2015, 1, 1), ], 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1) }
Response Structure
(dict) --
Describes a scheduled action. You can use a scheduled action to trigger some Amazon Redshift API operations on a schedule. For information about which API operations can be scheduled, see ScheduledActionType .
ScheduledActionName (string) --
The name of the scheduled action.
TargetAction (dict) --
A JSON format string of the Amazon Redshift API operation with input parameters.
"{\"ResizeCluster\":{\"NodeType\":\"ds2.8xlarge\",\"ClusterIdentifier\":\"my-test-cluster\",\"NumberOfNodes\":3}} ".
ResizeCluster (dict) --
An action that runs a ResizeCluster API operation.
ClusterIdentifier (string) --
The unique identifier for the cluster to resize.
ClusterType (string) --
The new cluster type for the specified cluster.
NodeType (string) --
The new node type for the nodes you are adding. If not specified, the cluster's current node type is used.
NumberOfNodes (integer) --
The new number of nodes for the cluster.
Classic (boolean) --
A boolean value indicating whether the resize operation is using the classic resize process. If you don't provide this parameter or set the value to false , the resize type is elastic.
Schedule (string) --
The schedule for a one-time (at format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour.
Format of at expressions is "at(yyyy-mm-ddThh:mm:ss) ". For example, "at(2016-03-04T17:27:00) ".
Format of cron expressions is "cron(Minutes Hours Day-of-month Month Day-of-week Year) ". For example, "cron(0, 10, *, *, MON, *) ". For more information, see Cron Expressions in the Amazon CloudWatch Events User Guide .
IamRole (string) --
The IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler (Principal scheduler.redshift.amazonaws.com) to assume permissions on your behalf. For more information about the IAM role to use with the Amazon Redshift scheduler, see Using Identity-Based Policies for Amazon Redshift in the Amazon Redshift Cluster Management Guide .
ScheduledActionDescription (string) --
The description of the scheduled action.
State (string) --
The state of the scheduled action. For example, DISABLED .
NextInvocations (list) --
List of times when the scheduled action will run.
(datetime) --
StartTime (datetime) --
The start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger.
EndTime (datetime) --
The end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger.
Describes properties of scheduled actions.
See also: AWS API Documentation
Request Syntax
client.describe_scheduled_actions( ScheduledActionName='string', TargetActionType='ResizeCluster', StartTime=datetime(2015, 1, 1), EndTime=datetime(2015, 1, 1), Active=True|False, Filters=[ { 'Name': 'cluster-identifier'|'iam-role', 'Values': [ 'string', ] }, ], Marker='string', MaxRecords=123 )
string
The name of the scheduled action to retrieve.
string
The type of the scheduled actions to retrieve.
datetime
The start time in UTC of the scheduled actions to retrieve. Only active scheduled actions that have invocations after this time are retrieved.
datetime
The end time in UTC of the scheduled action to retrieve. Only active scheduled actions that have invocations before this time are retrieved.
boolean
If true, retrieve only active scheduled actions. If false, retrieve only disabled scheduled actions.
list
List of scheduled action filters.
(dict) --
A set of elements to filter the returned scheduled actions.
Name (string) -- [REQUIRED]
The type of element to filter.
Values (list) -- [REQUIRED]
List of values. Compare if the value (of type defined by Name ) equals an item in the list of scheduled actions.
(string) --
string
An optional parameter that specifies the starting point to return a set of response records. When the results of a DescribeScheduledActions request exceed the value specified in MaxRecords , AWS returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retrying the request.
integer
The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified MaxRecords value, a value is returned in a marker field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.
Default: 100
Constraints: minimum 20, maximum 100.
dict
Response Syntax
{ 'Marker': 'string', 'ScheduledActions': [ { 'ScheduledActionName': 'string', 'TargetAction': { 'ResizeCluster': { 'ClusterIdentifier': 'string', 'ClusterType': 'string', 'NodeType': 'string', 'NumberOfNodes': 123, 'Classic': True|False } }, 'Schedule': 'string', 'IamRole': 'string', 'ScheduledActionDescription': 'string', 'State': 'ACTIVE'|'DISABLED', 'NextInvocations': [ datetime(2015, 1, 1), ], 'StartTime': datetime(2015, 1, 1), 'EndTime': datetime(2015, 1, 1) }, ] }
Response Structure
(dict) --
Marker (string) --
An optional parameter that specifies the starting point to return a set of response records. When the results of a DescribeScheduledActions request exceed the value specified in MaxRecords , AWS returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retrying the request.
ScheduledActions (list) --
List of retrieved scheduled actions.
(dict) --
Describes a scheduled action. You can use a scheduled action to trigger some Amazon Redshift API operations on a schedule. For information about which API operations can be scheduled, see ScheduledActionType .
ScheduledActionName (string) --
The name of the scheduled action.
TargetAction (dict) --
A JSON format string of the Amazon Redshift API operation with input parameters.
"{\"ResizeCluster\":{\"NodeType\":\"ds2.8xlarge\",\"ClusterIdentifier\":\"my-test-cluster\",\"NumberOfNodes\":3}} ".
ResizeCluster (dict) --
An action that runs a ResizeCluster API operation.
ClusterIdentifier (string) --
The unique identifier for the cluster to resize.
ClusterType (string) --
The new cluster type for the specified cluster.
NodeType (string) --
The new node type for the nodes you are adding. If not specified, the cluster's current node type is used.
NumberOfNodes (integer) --
The new number of nodes for the cluster.
Classic (boolean) --
A boolean value indicating whether the resize operation is using the classic resize process. If you don't provide this parameter or set the value to false , the resize type is elastic.
Schedule (string) --
The schedule for a one-time (at format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour.
Format of at expressions is "at(yyyy-mm-ddThh:mm:ss) ". For example, "at(2016-03-04T17:27:00) ".
Format of cron expressions is "cron(Minutes Hours Day-of-month Month Day-of-week Year) ". For example, "cron(0, 10, *, *, MON, *) ". For more information, see Cron Expressions in the Amazon CloudWatch Events User Guide .
IamRole (string) --
The IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler (Principal scheduler.redshift.amazonaws.com) to assume permissions on your behalf. For more information about the IAM role to use with the Amazon Redshift scheduler, see Using Identity-Based Policies for Amazon Redshift in the Amazon Redshift Cluster Management Guide .
ScheduledActionDescription (string) --
The description of the scheduled action.
State (string) --
The state of the scheduled action. For example, DISABLED .
NextInvocations (list) --
List of times when the scheduled action will run.
(datetime) --
StartTime (datetime) --
The start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger.
EndTime (datetime) --
The end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger.
{'SourceType': ['scheduled-action']}Response
{'Events': {'SourceType': ['scheduled-action']}}
Returns events related to clusters, security groups, snapshots, and parameter groups for the past 14 days. Events specific to a particular cluster, security group, snapshot or parameter group can be obtained by providing the name as a parameter. By default, the past hour of events are returned.
See also: AWS API Documentation
Request Syntax
client.describe_events( SourceIdentifier='string', SourceType='cluster'|'cluster-parameter-group'|'cluster-security-group'|'cluster-snapshot'|'scheduled-action', StartTime=datetime(2015, 1, 1), EndTime=datetime(2015, 1, 1), Duration=123, MaxRecords=123, Marker='string' )
string
The identifier of the event source for which events will be returned. If this parameter is not specified, then all sources are included in the response.
Constraints:
If SourceIdentifier is supplied, SourceType must also be provided.
Specify a cluster identifier when SourceType is cluster .
Specify a cluster security group name when SourceType is cluster-security-group .
Specify a cluster parameter group name when SourceType is cluster-parameter-group .
Specify a cluster snapshot identifier when SourceType is cluster-snapshot .
string
The event source to retrieve events for. If no value is specified, all events are returned.
Constraints:
If SourceType is supplied, SourceIdentifier must also be provided.
Specify cluster when SourceIdentifier is a cluster identifier.
Specify cluster-security-group when SourceIdentifier is a cluster security group name.
Specify cluster-parameter-group when SourceIdentifier is a cluster parameter group name.
Specify cluster-snapshot when SourceIdentifier is a cluster snapshot identifier.
datetime
The beginning of the time interval to retrieve events for, specified in ISO 8601 format. For more information about ISO 8601, go to the ISO8601 Wikipedia page.
Example: 2009-07-08T18:00Z
datetime
The end of the time interval for which to retrieve events, specified in ISO 8601 format. For more information about ISO 8601, go to the ISO8601 Wikipedia page.
Example: 2009-07-08T18:00Z
integer
The number of minutes prior to the time of the request for which to retrieve events. For example, if the request is sent at 18:00 and you specify a duration of 60, then only events which have occurred after 17:00 will be returned.
Default: 60
integer
The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified MaxRecords value, a value is returned in a marker field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.
Default: 100
Constraints: minimum 20, maximum 100.
string
An optional parameter that specifies the starting point to return a set of response records. When the results of a DescribeEvents request exceed the value specified in MaxRecords , AWS returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retrying the request.
dict
Response Syntax
{ 'Marker': 'string', 'Events': [ { 'SourceIdentifier': 'string', 'SourceType': 'cluster'|'cluster-parameter-group'|'cluster-security-group'|'cluster-snapshot'|'scheduled-action', 'Message': 'string', 'EventCategories': [ 'string', ], 'Severity': 'string', 'Date': datetime(2015, 1, 1), 'EventId': 'string' }, ] }
Response Structure
(dict) --
Marker (string) --
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned marker value in the Marker parameter and retrying the command. If the Marker field is empty, all response records have been retrieved for the request.
Events (list) --
A list of Event instances.
(dict) --
Describes an event.
SourceIdentifier (string) --
The identifier for the source of the event.
SourceType (string) --
The source type for this event.
Message (string) --
The text of this event.
EventCategories (list) --
A list of the event categories.
Values: Configuration, Management, Monitoring, Security
(string) --
Severity (string) --
The severity of the event.
Values: ERROR, INFO
Date (datetime) --
The date and time of the event.
EventId (string) --
The identifier of the event.
{'ActionType': ['recommend-node-config'], 'ClusterIdentifier': 'string', 'Filters': {'Name': ['Mode']}}Response
{'NodeConfigurationOptionList': {'Mode': 'standard | high-performance'}}
Returns properties of possible node configurations such as node type, number of nodes, and disk usage for the specified action type.
See also: AWS API Documentation
Request Syntax
client.describe_node_configuration_options( ActionType='restore-cluster'|'recommend-node-config', ClusterIdentifier='string', SnapshotIdentifier='string', OwnerAccount='string', Filters=[ { 'Name': 'NodeType'|'NumberOfNodes'|'EstimatedDiskUtilizationPercent'|'Mode', 'Operator': 'eq'|'lt'|'gt'|'le'|'ge'|'in'|'between', 'Values': [ 'string', ] }, ], Marker='string', MaxRecords=123 )
string
[REQUIRED]
The action type to evaluate for possible node configurations. Specify "restore-cluster" to get configuration combinations based on an existing snapshot. Specify "recommend-node-config" to get configuration recommendations based on an existing cluster or snapshot.
string
The identifier of the cluster to evaluate for possible node configurations.
string
The identifier of the snapshot to evaluate for possible node configurations.
string
The AWS customer account used to create or copy the snapshot. Required if you are restoring a snapshot you do not own, optional if you own the snapshot.
list
A set of name, operator, and value items to filter the results.
(dict) --
A set of elements to filter the returned node configurations.
Name (string) --
The name of the element to filter.
Operator (string) --
The filter operator. If filter Name is NodeType only the 'in' operator is supported. Provide one value to evaluate for 'eq', 'lt', 'le', 'gt', and 'ge'. Provide two values to evaluate for 'between'. Provide a list of values for 'in'.
Values (list) --
List of values. Compare Name using Operator to Values. If filter Name is NumberOfNodes, then values can range from 0 to 200. If filter Name is EstimatedDiskUtilizationPercent, then values can range from 0 to 100. For example, filter NumberOfNodes (name) GT (operator) 3 (values).
(string) --
string
An optional parameter that specifies the starting point to return a set of response records. When the results of a DescribeNodeConfigurationOptions request exceed the value specified in MaxRecords , AWS returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retrying the request.
integer
The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified MaxRecords value, a value is returned in a marker field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.
Default: 500
Constraints: minimum 100, maximum 500.
dict
Response Syntax
{ 'NodeConfigurationOptionList': [ { 'NodeType': 'string', 'NumberOfNodes': 123, 'EstimatedDiskUtilizationPercent': 123.0, 'Mode': 'standard'|'high-performance' }, ], 'Marker': 'string' }
Response Structure
(dict) --
NodeConfigurationOptionList (list) --
A list of valid node configurations.
(dict) --
A list of node configurations.
NodeType (string) --
The node type, such as, "ds2.8xlarge".
NumberOfNodes (integer) --
The number of nodes.
EstimatedDiskUtilizationPercent (float) --
The estimated disk utilizaton percentage.
Mode (string) --
The category of the node configuration recommendation.
Marker (string) --
A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned marker value in the Marker parameter and retrying the command. If the Marker field is empty, all response records have been retrieved for the request.