Skip to content

create_channel_group async

create_channel_group(
    channel_group_name: ResourceName,
    *,
    config_overrides: Optional[AsyncMediaPackageV2ClientConfig] = None,
    client_token: Optional[IdempotencyToken] = None,
    description: Optional[ResourceDescription] = None,
    tags: Optional[TagMap] = None,
) -> 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.

Parameters:

  • channel_group_name (ResourceName) –

    The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region. You can't use spaces in the name. You can't change the name after you create the channel group.

  • client_token (Optional[IdempotencyToken], default: None ) –

    A unique, case-sensitive token that you provide to ensure the idempotency of the request.

  • description (Optional[ResourceDescription], default: None ) –

    Enter any descriptive text that helps you to identify the channel group.

  • tags (Optional[TagMap], default: None ) –

    A comma-separated list of tag key:value pairs that you define. For example:

    "Key1": "Value1",

    "Key2": "Value2"

Raises:

  • AccessDeniedException –

    Access is denied because either you don't have permissions to perform the requested operation or MediaPackage is getting throttling errors with CDN authorization. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see Access Management in the IAM User Guide. Or, if you're using CDN authorization, you will receive this exception if MediaPackage receives a throttling error from Secrets Manager.

  • ConflictException –

    Updating or deleting this resource can cause an inconsistent state.

  • InternalServerException –

    Indicates that an error from the service occurred while trying to process a request.

  • ResourceNotFoundException –

    The specified resource doesn't exist.

  • ServiceQuotaExceededException –

    The request would cause a service quota to be exceeded.

  • ThrottlingException –

    The request throughput limit was exceeded.

  • ValidationException –

    The input failed to meet the constraints specified by the AWS service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Creating a Channel Group

>>> await client.create_channel_group(channel_group_name='exampleChannelGroup', description='Description for exampleChannelGroup', tags={'key1': 'value1', 'key2': 'value2'})
Source code in docs_src/capo_mediapackagev2/_services/async_media_package_v2.py
async def create_channel_group(
    self,
    channel_group_name: "capo_mediapackagev2.types.resource_name.ResourceName",
    *,
    config_overrides: Optional[AsyncMediaPackageV2ClientConfig] = None,
    client_token: Optional[
        "capo_mediapackagev2.types.idempotency_token.IdempotencyToken"
    ] = None,
    description: Optional[
        "capo_mediapackagev2.types.resource_description.ResourceDescription"
    ] = None,
    tags: Optional["capo_mediapackagev2.types.tag_map.TagMap"] = None,
) -> "capo_mediapackagev2.types.create_channel_group_response.CreateChannelGroupResponse":
    """<p>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. </p>

    Args:
        channel_group_name: <p>The name that describes the channel group. The name is the primary identifier for the channel group, and must be unique for your account in the AWS Region. You can't use spaces in the name. You can't change the name after you create the channel group.</p>
        client_token: <p>A unique, case-sensitive token that you provide to ensure the idempotency of the request.</p>
        description: <p>Enter any descriptive text that helps you to identify the channel group.</p>
        tags: <p>A comma-separated list of tag key:value pairs that you define. For example:</p> <p> <code>"Key1": "Value1",</code> </p> <p> <code>"Key2": "Value2"</code> </p>

    Raises:
        capo_mediapackagev2.errors.access_denied_exception.AccessDeniedException: <p>Access is denied because either you don't have permissions to perform the requested operation or MediaPackage is getting throttling errors with CDN authorization. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see Access Management in the IAM User Guide. Or, if you're using CDN authorization, you will receive this exception if MediaPackage receives a throttling error from Secrets Manager.</p>
        capo_mediapackagev2.errors.conflict_exception.ConflictException: <p>Updating or deleting this resource can cause an inconsistent state.</p>
        capo_mediapackagev2.errors.internal_server_exception.InternalServerException: <p>Indicates that an error from the service occurred while trying to process a request.</p>
        capo_mediapackagev2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource doesn't exist.</p>
        capo_mediapackagev2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would cause a service quota to be exceeded.</p>
        capo_mediapackagev2.errors.throttling_exception.ThrottlingException: <p>The request throughput limit was exceeded.</p>
        capo_mediapackagev2.errors.validation_exception.ValidationException: <p>The input failed to meet the constraints specified by the AWS service.</p>
        capo_mediapackagev2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Creating a Channel Group

        >>> await client.create_channel_group(channel_group_name='exampleChannelGroup', description='Description for exampleChannelGroup', tags={'key1': 'value1', 'key2': 'value2'})
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mediapackagev2.types.create_channel_group_request.CreateChannelGroupRequest]",
    ) -> AsyncOperationResponse[
        "capo_mediapackagev2.types.create_channel_group_response.CreateChannelGroupResponse"
    ]:
        import capo_mediapackagev2._operations.mediapackagev2.create_channel_group

        (
            output,
            http_response,
        ) = await capo_mediapackagev2._operations.mediapackagev2.create_channel_group.async_create_channel_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateChannelGroup")
    )
    input_: capo_mediapackagev2.types.create_channel_group_request.CreateChannelGroupRequest = {
        "channel_group_name": channel_group_name
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output