Class: Aws::MediaPackageV2::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::MediaPackageV2::Client
- Includes:
- ClientStubs
- Defined in:
- gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb
Overview
An API client for MediaPackageV2. To construct a client, you need to configure a :region
and :credentials
.
client = Aws::MediaPackageV2::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the developer guide.
See #initialize for a full list of supported configuration options.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
API Operations collapse
-
#cancel_harvest_job(params = {}) ⇒ Struct
Cancels an in-progress harvest job.
-
#create_channel(params = {}) ⇒ Types::CreateChannelResponse
Create a channel to start receiving content streams.
-
#create_channel_group(params = {}) ⇒ Types::CreateChannelGroupResponse
Create a channel group to group your channels and origin endpoints.
-
#create_harvest_job(params = {}) ⇒ Types::CreateHarvestJobResponse
Creates a new harvest job to export content from a MediaPackage v2 channel to an S3 bucket.
-
#create_origin_endpoint(params = {}) ⇒ Types::CreateOriginEndpointResponse
The endpoint is attached to a channel, and represents the output of the live content.
-
#delete_channel(params = {}) ⇒ Struct
Delete a channel to stop AWS Elemental MediaPackage from receiving further content.
-
#delete_channel_group(params = {}) ⇒ Struct
Delete a channel group.
-
#delete_channel_policy(params = {}) ⇒ Struct
Delete a channel policy.
-
#delete_origin_endpoint(params = {}) ⇒ Struct
Origin endpoints can serve content until they're deleted.
-
#delete_origin_endpoint_policy(params = {}) ⇒ Struct
Delete an origin endpoint policy.
-
#get_channel(params = {}) ⇒ Types::GetChannelResponse
Retrieves the specified channel that's configured in AWS Elemental MediaPackage, including the origin endpoints that are associated with it.
-
#get_channel_group(params = {}) ⇒ Types::GetChannelGroupResponse
Retrieves the specified channel group that's configured in AWS Elemental MediaPackage, including the channels and origin endpoints that are associated with it.
-
#get_channel_policy(params = {}) ⇒ Types::GetChannelPolicyResponse
Retrieves the specified channel policy that's configured in AWS Elemental MediaPackage.
-
#get_harvest_job(params = {}) ⇒ Types::GetHarvestJobResponse
Retrieves the details of a specific harvest job.
-
#get_origin_endpoint(params = {}) ⇒ Types::GetOriginEndpointResponse
Retrieves the specified origin endpoint that's configured in AWS Elemental MediaPackage to obtain its playback URL and to view the packaging settings that it's currently using.
-
#get_origin_endpoint_policy(params = {}) ⇒ Types::GetOriginEndpointPolicyResponse
Retrieves the specified origin endpoint policy that's configured in AWS Elemental MediaPackage.
-
#list_channel_groups(params = {}) ⇒ Types::ListChannelGroupsResponse
Retrieves all channel groups that are configured in AWS Elemental MediaPackage, including the channels and origin endpoints that are associated with it.
-
#list_channels(params = {}) ⇒ Types::ListChannelsResponse
Retrieves all channels in a specific channel group that are configured in AWS Elemental MediaPackage, including the origin endpoints that are associated with it.
-
#list_harvest_jobs(params = {}) ⇒ Types::ListHarvestJobsResponse
Retrieves a list of harvest jobs that match the specified criteria.
-
#list_origin_endpoints(params = {}) ⇒ Types::ListOriginEndpointsResponse
Retrieves all origin endpoints in a specific channel that are configured in AWS Elemental MediaPackage.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags assigned to a resource.
-
#put_channel_policy(params = {}) ⇒ Struct
Attaches an IAM policy to the specified channel.
-
#put_origin_endpoint_policy(params = {}) ⇒ Struct
Attaches an IAM policy to the specified origin endpoint.
-
#tag_resource(params = {}) ⇒ Struct
Assigns one of more tags (key-value pairs) to the specified MediaPackage resource.
-
#untag_resource(params = {}) ⇒ Struct
Removes one or more tags from the specified resource.
-
#update_channel(params = {}) ⇒ Types::UpdateChannelResponse
Update the specified channel.
-
#update_channel_group(params = {}) ⇒ Types::UpdateChannelGroupResponse
Update the specified channel group.
-
#update_origin_endpoint(params = {}) ⇒ Types::UpdateOriginEndpointResponse
Update the specified origin endpoint.
Instance Method Summary collapse
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
-
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
Methods included from ClientStubs
#api_requests, #stub_data, #stub_responses
Methods inherited from Seahorse::Client::Base
add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
444 445 446 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 444 def initialize(*args) super end |
Instance Method Details
#cancel_harvest_job(params = {}) ⇒ Struct
Cancels an in-progress harvest job.
501 502 503 504 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 501 def cancel_harvest_job(params = {}, = {}) req = build_request(:cancel_harvest_job, params) req.send_request() end |
#create_channel(params = {}) ⇒ Types::CreateChannelResponse
Create a channel to start receiving content streams. The channel represents the input to MediaPackage for incoming live content from an encoder such as AWS Elemental MediaLive. The channel receives content, and after packaging it, outputs it through an origin endpoint to downstream devices (such as video players or CDNs) that request the content. You can create only one channel with each request. We recommend that you spread out channels between channel groups, such as putting redundant channels in the same AWS Region in different channel groups.
664 665 666 667 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 664 def create_channel(params = {}, = {}) req = build_request(:create_channel, params) req.send_request() end |
#create_channel_group(params = {}) ⇒ Types::CreateChannelGroupResponse
Create a channel group to group your channels and origin endpoints. A channel group is the top-level resource that consists of channels and origin endpoints that are associated with it and that provides predictable URLs for stream delivery. All channels and origin endpoints within the channel group are guaranteed to share the DNS. You can create only one channel group with each request.
766 767 768 769 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 766 def create_channel_group(params = {}, = {}) req = build_request(:create_channel_group, params) req.send_request() end |
#create_harvest_job(params = {}) ⇒ Types::CreateHarvestJobResponse
Creates a new harvest job to export content from a MediaPackage v2 channel to an S3 bucket.
982 983 984 985 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 982 def create_harvest_job(params = {}, = {}) req = build_request(:create_harvest_job, params) req.send_request() end |
#create_origin_endpoint(params = {}) ⇒ Types::CreateOriginEndpointResponse
The endpoint is attached to a channel, and represents the output of the live content. You can associate multiple endpoints to a single channel. Each endpoint gives players and downstream CDNs (such as Amazon CloudFront) access to the content for playback. Content can't be served from a channel until it has an endpoint. You can create only one endpoint with each request.
1741 1742 1743 1744 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 1741 def create_origin_endpoint(params = {}, = {}) req = build_request(:create_origin_endpoint, params) req.send_request() end |
#delete_channel(params = {}) ⇒ Struct
Delete a channel to stop AWS Elemental MediaPackage from receiving further content. You must delete the channel's origin endpoints before you can delete the channel.
1785 1786 1787 1788 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 1785 def delete_channel(params = {}, = {}) req = build_request(:delete_channel, params) req.send_request() end |
#delete_channel_group(params = {}) ⇒ Struct
Delete a channel group. You must delete the channel group's channels and origin endpoints before you can delete the channel group. If you delete a channel group, you'll lose access to the egress domain and will have to create a new channel group to replace it.
1823 1824 1825 1826 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 1823 def delete_channel_group(params = {}, = {}) req = build_request(:delete_channel_group, params) req.send_request() end |
#delete_channel_policy(params = {}) ⇒ Struct
Delete a channel policy.
1865 1866 1867 1868 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 1865 def delete_channel_policy(params = {}, = {}) req = build_request(:delete_channel_policy, params) req.send_request() end |
#delete_origin_endpoint(params = {}) ⇒ Struct
Origin endpoints can serve content until they're deleted. Delete the endpoint if it should no longer respond to playback requests. You must delete all endpoints from a channel before you can delete the channel.
1916 1917 1918 1919 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 1916 def delete_origin_endpoint(params = {}, = {}) req = build_request(:delete_origin_endpoint, params) req.send_request() end |
#delete_origin_endpoint_policy(params = {}) ⇒ Struct
Delete an origin endpoint policy.
1965 1966 1967 1968 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 1965 def delete_origin_endpoint_policy(params = {}, = {}) req = build_request(:delete_origin_endpoint_policy, params) req.send_request() end |
#get_channel(params = {}) ⇒ Types::GetChannelResponse
Retrieves the specified channel that's configured in AWS Elemental MediaPackage, including the origin endpoints that are associated with it.
2062 2063 2064 2065 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 2062 def get_channel(params = {}, = {}) req = build_request(:get_channel, params) req.send_request() end |
#get_channel_group(params = {}) ⇒ Types::GetChannelGroupResponse
Retrieves the specified channel group that's configured in AWS Elemental MediaPackage, including the channels and origin endpoints that are associated with it.
2131 2132 2133 2134 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 2131 def get_channel_group(params = {}, = {}) req = build_request(:get_channel_group, params) req.send_request() end |
#get_channel_policy(params = {}) ⇒ Types::GetChannelPolicyResponse
Retrieves the specified channel policy that's configured in AWS Elemental MediaPackage. With policies, you can specify who has access to AWS resources and what actions they can perform on those resources.
2188 2189 2190 2191 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 2188 def get_channel_policy(params = {}, = {}) req = build_request(:get_channel_policy, params) req.send_request() end |
#get_harvest_job(params = {}) ⇒ Types::GetHarvestJobResponse
Retrieves the details of a specific harvest job.
The following waiters are defined for this operation (see #wait_until for detailed usage):
- harvest_job_finished
2325 2326 2327 2328 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 2325 def get_harvest_job(params = {}, = {}) req = build_request(:get_harvest_job, params) req.send_request() end |
#get_origin_endpoint(params = {}) ⇒ Types::GetOriginEndpointResponse
Retrieves the specified origin endpoint that's configured in AWS Elemental MediaPackage to obtain its playback URL and to view the packaging settings that it's currently using.
2573 2574 2575 2576 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 2573 def get_origin_endpoint(params = {}, = {}) req = build_request(:get_origin_endpoint, params) req.send_request() end |
#get_origin_endpoint_policy(params = {}) ⇒ Types::GetOriginEndpointPolicyResponse
Retrieves the specified origin endpoint policy that's configured in AWS Elemental MediaPackage.
2639 2640 2641 2642 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 2639 def get_origin_endpoint_policy(params = {}, = {}) req = build_request(:get_origin_endpoint_policy, params) req.send_request() end |
#list_channel_groups(params = {}) ⇒ Types::ListChannelGroupsResponse
Retrieves all channel groups that are configured in AWS Elemental MediaPackage, including the channels and origin endpoints that are associated with it.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
2708 2709 2710 2711 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 2708 def list_channel_groups(params = {}, = {}) req = build_request(:list_channel_groups, params) req.send_request() end |
#list_channels(params = {}) ⇒ Types::ListChannelsResponse
Retrieves all channels in a specific channel group that are configured in AWS Elemental MediaPackage, including the origin endpoints that are associated with it.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
2788 2789 2790 2791 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 2788 def list_channels(params = {}, = {}) req = build_request(:list_channels, params) req.send_request() end |
#list_harvest_jobs(params = {}) ⇒ Types::ListHarvestJobsResponse
Retrieves a list of harvest jobs that match the specified criteria.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
2869 2870 2871 2872 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 2869 def list_harvest_jobs(params = {}, = {}) req = build_request(:list_harvest_jobs, params) req.send_request() end |
#list_origin_endpoints(params = {}) ⇒ Types::ListOriginEndpointsResponse
Retrieves all origin endpoints in a specific channel that are configured in AWS Elemental MediaPackage.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
3047 3048 3049 3050 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 3047 def list_origin_endpoints(params = {}, = {}) req = build_request(:list_origin_endpoints, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags assigned to a resource.
3091 3092 3093 3094 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 3091 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#put_channel_policy(params = {}) ⇒ Struct
Attaches an IAM policy to the specified channel. With policies, you can specify who has access to AWS resources and what actions they can perform on those resources. You can attach only one policy with each request.
3141 3142 3143 3144 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 3141 def put_channel_policy(params = {}, = {}) req = build_request(:put_channel_policy, params) req.send_request() end |
#put_origin_endpoint_policy(params = {}) ⇒ Struct
Attaches an IAM policy to the specified origin endpoint. You can attach only one policy with each request.
3196 3197 3198 3199 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 3196 def put_origin_endpoint_policy(params = {}, = {}) req = build_request(:put_origin_endpoint_policy, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Assigns one of more tags (key-value pairs) to the specified MediaPackage resource.
Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only resources with certain tag values. You can use the TagResource operation with a resource that already has tags. If you specify a new tag key for the resource, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag value that you specify replaces the previous value for that tag.
3250 3251 3252 3253 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 3250 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes one or more tags from the specified resource.
3291 3292 3293 3294 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 3291 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_channel(params = {}) ⇒ Types::UpdateChannelResponse
Update the specified channel. You can edit if MediaPackage sends ingest or egress access logs to the CloudWatch log group, if content will be encrypted, the description on a channel, and your channel's policy settings. You can't edit the name of the channel or CloudFront distribution details.
Any edits you make that impact the video output may not be reflected for a few minutes.
3421 3422 3423 3424 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 3421 def update_channel(params = {}, = {}) req = build_request(:update_channel, params) req.send_request() end |
#update_channel_group(params = {}) ⇒ Types::UpdateChannelGroupResponse
Update the specified channel group. You can edit the description on a channel group for easier identification later from the AWS Elemental MediaPackage console. You can't edit the name of the channel group.
Any edits you make that impact the video output may not be reflected for a few minutes.
3505 3506 3507 3508 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 3505 def update_channel_group(params = {}, = {}) req = build_request(:update_channel_group, params) req.send_request() end |
#update_origin_endpoint(params = {}) ⇒ Types::UpdateOriginEndpointResponse
Update the specified origin endpoint. Edit the packaging preferences on an endpoint to optimize the viewing experience. You can't edit the name of the endpoint.
Any edits you make that impact the video output may not be reflected for a few minutes.
3978 3979 3980 3981 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 3978 def update_origin_endpoint(params = {}, = {}) req = build_request(:update_origin_endpoint, params) req.send_request() end |
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
Basic Usage
A waiter will call an API operation until:
- It is successful
- It enters a terminal state
- It makes the maximum number of attempts
In between attempts, the waiter will sleep.
# polls in a loop, sleeping between attempts
client.wait_until(waiter_name, params)
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.
# poll for ~25 seconds
client.wait_until(waiter_name, params, {
max_attempts: 5,
delay: 5,
})
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success
or :failure
from these callbacks,
it will terminate the waiter.
started_at = Time.now
client.wait_until(waiter_name, params, {
# disable max attempts
max_attempts: nil,
# poll for 1 hour, instead of a number of attempts
before_wait: -> (attempts, response) do
throw :failure if Time.now - started_at > 3600
end
})
Handling Errors
When a waiter is unsuccessful, it will raise an error. All of the failure errors extend from Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
Valid Waiters
The following table lists the valid waiter names, the operations they call,
and the default :delay
and :max_attempts
values.
waiter_name | params | :delay | :max_attempts |
---|---|---|---|
harvest_job_finished | #get_harvest_job | 2 | 60 |
4093 4094 4095 4096 4097 |
# File 'gems/aws-sdk-mediapackagev2/lib/aws-sdk-mediapackagev2/client.rb', line 4093 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |