# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs

__all__ = [
    'GetInvocationResult',
    'AwaitableGetInvocationResult',
    'get_invocation',
    'get_invocation_output',
]

@pulumi.output_type
class GetInvocationResult:
    """
    A collection of values returned by getInvocation.
    """
    def __init__(__self__, command_content=None, command_description=None, command_id=None, command_name=None, command_provider=None, command_type=None, enable_parameter=None, end_time=None, frequency=None, id=None, instance_ids=None, instance_number=None, invocation_description=None, invocation_id=None, invocation_name=None, invocation_results=None, invocation_status=None, launch_time=None, parameter_definitions=None, parameters=None, project_name=None, recurrence_end_time=None, repeat_mode=None, start_time=None, tags=None, timeout=None, username=None, windows_password=None, working_dir=None):
        if command_content and not isinstance(command_content, str):
            raise TypeError("Expected argument 'command_content' to be a str")
        pulumi.set(__self__, "command_content", command_content)
        if command_description and not isinstance(command_description, str):
            raise TypeError("Expected argument 'command_description' to be a str")
        pulumi.set(__self__, "command_description", command_description)
        if command_id and not isinstance(command_id, str):
            raise TypeError("Expected argument 'command_id' to be a str")
        pulumi.set(__self__, "command_id", command_id)
        if command_name and not isinstance(command_name, str):
            raise TypeError("Expected argument 'command_name' to be a str")
        pulumi.set(__self__, "command_name", command_name)
        if command_provider and not isinstance(command_provider, str):
            raise TypeError("Expected argument 'command_provider' to be a str")
        pulumi.set(__self__, "command_provider", command_provider)
        if command_type and not isinstance(command_type, str):
            raise TypeError("Expected argument 'command_type' to be a str")
        pulumi.set(__self__, "command_type", command_type)
        if enable_parameter and not isinstance(enable_parameter, bool):
            raise TypeError("Expected argument 'enable_parameter' to be a bool")
        pulumi.set(__self__, "enable_parameter", enable_parameter)
        if end_time and not isinstance(end_time, str):
            raise TypeError("Expected argument 'end_time' to be a str")
        pulumi.set(__self__, "end_time", end_time)
        if frequency and not isinstance(frequency, str):
            raise TypeError("Expected argument 'frequency' to be a str")
        pulumi.set(__self__, "frequency", frequency)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if instance_ids and not isinstance(instance_ids, list):
            raise TypeError("Expected argument 'instance_ids' to be a list")
        pulumi.set(__self__, "instance_ids", instance_ids)
        if instance_number and not isinstance(instance_number, int):
            raise TypeError("Expected argument 'instance_number' to be a int")
        pulumi.set(__self__, "instance_number", instance_number)
        if invocation_description and not isinstance(invocation_description, str):
            raise TypeError("Expected argument 'invocation_description' to be a str")
        pulumi.set(__self__, "invocation_description", invocation_description)
        if invocation_id and not isinstance(invocation_id, str):
            raise TypeError("Expected argument 'invocation_id' to be a str")
        pulumi.set(__self__, "invocation_id", invocation_id)
        if invocation_name and not isinstance(invocation_name, str):
            raise TypeError("Expected argument 'invocation_name' to be a str")
        pulumi.set(__self__, "invocation_name", invocation_name)
        if invocation_results and not isinstance(invocation_results, list):
            raise TypeError("Expected argument 'invocation_results' to be a list")
        pulumi.set(__self__, "invocation_results", invocation_results)
        if invocation_status and not isinstance(invocation_status, str):
            raise TypeError("Expected argument 'invocation_status' to be a str")
        pulumi.set(__self__, "invocation_status", invocation_status)
        if launch_time and not isinstance(launch_time, str):
            raise TypeError("Expected argument 'launch_time' to be a str")
        pulumi.set(__self__, "launch_time", launch_time)
        if parameter_definitions and not isinstance(parameter_definitions, list):
            raise TypeError("Expected argument 'parameter_definitions' to be a list")
        pulumi.set(__self__, "parameter_definitions", parameter_definitions)
        if parameters and not isinstance(parameters, str):
            raise TypeError("Expected argument 'parameters' to be a str")
        pulumi.set(__self__, "parameters", parameters)
        if project_name and not isinstance(project_name, str):
            raise TypeError("Expected argument 'project_name' to be a str")
        pulumi.set(__self__, "project_name", project_name)
        if recurrence_end_time and not isinstance(recurrence_end_time, str):
            raise TypeError("Expected argument 'recurrence_end_time' to be a str")
        pulumi.set(__self__, "recurrence_end_time", recurrence_end_time)
        if repeat_mode and not isinstance(repeat_mode, str):
            raise TypeError("Expected argument 'repeat_mode' to be a str")
        pulumi.set(__self__, "repeat_mode", repeat_mode)
        if start_time and not isinstance(start_time, str):
            raise TypeError("Expected argument 'start_time' to be a str")
        pulumi.set(__self__, "start_time", start_time)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if timeout and not isinstance(timeout, int):
            raise TypeError("Expected argument 'timeout' to be a int")
        pulumi.set(__self__, "timeout", timeout)
        if username and not isinstance(username, str):
            raise TypeError("Expected argument 'username' to be a str")
        pulumi.set(__self__, "username", username)
        if windows_password and not isinstance(windows_password, str):
            raise TypeError("Expected argument 'windows_password' to be a str")
        pulumi.set(__self__, "windows_password", windows_password)
        if working_dir and not isinstance(working_dir, str):
            raise TypeError("Expected argument 'working_dir' to be a str")
        pulumi.set(__self__, "working_dir", working_dir)

    @property
    @pulumi.getter(name="commandContent")
    def command_content(self) -> builtins.str:
        """
        命令内容。
        """
        return pulumi.get(self, "command_content")

    @property
    @pulumi.getter(name="commandDescription")
    def command_description(self) -> builtins.str:
        """
        被调用命令的描述。
        """
        return pulumi.get(self, "command_description")

    @property
    @pulumi.getter(name="commandId")
    def command_id(self) -> builtins.str:
        """
        命令ID。
        """
        return pulumi.get(self, "command_id")

    @property
    @pulumi.getter(name="commandName")
    def command_name(self) -> builtins.str:
        """
        任务触发时的命令名称。
        """
        return pulumi.get(self, "command_name")

    @property
    @pulumi.getter(name="commandProvider")
    def command_provider(self) -> builtins.str:
        """
        被调用命令的提供方。
        """
        return pulumi.get(self, "command_provider")

    @property
    @pulumi.getter(name="commandType")
    def command_type(self) -> builtins.str:
        """
        作业触发的命令类型。
        """
        return pulumi.get(self, "command_type")

    @property
    @pulumi.getter(name="enableParameter")
    def enable_parameter(self) -> builtins.bool:
        """
        被调用命令是否使用自定义参数。true：已启用。false：未启用。
        """
        return pulumi.get(self, "enable_parameter")

    @property
    @pulumi.getter(name="endTime")
    def end_time(self) -> builtins.str:
        """
        任务结束时间。
        """
        return pulumi.get(self, "end_time")

    @property
    @pulumi.getter
    def frequency(self) -> builtins.str:
        """
        执行频率。RepeatMode=Rate 时本参数必填。格式：<执行间隔数值><执行间隔单位>，执行间隔单位：支持分钟（5m-60m）、小时（1h-24h）和天（1d-7d）。执行间隔基于固定频率，与作业实际执行需要的时间无关。创建作业后基于LaunchTime执行一次，根据间隔设置确定下一次执行时间。
        """
        return pulumi.get(self, "frequency")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="instanceIds")
    def instance_ids(self) -> Sequence[builtins.str]:
        """
        实例ID列表，最多支持200个ID。
        """
        return pulumi.get(self, "instance_ids")

    @property
    @pulumi.getter(name="instanceNumber")
    def instance_number(self) -> builtins.int:
        """
        执行实例数量。
        """
        return pulumi.get(self, "instance_number")

    @property
    @pulumi.getter(name="invocationDescription")
    def invocation_description(self) -> builtins.str:
        """
        作业描述，默认为空字符串，不超过256个字符。
        """
        return pulumi.get(self, "invocation_description")

    @property
    @pulumi.getter(name="invocationId")
    def invocation_id(self) -> builtins.str:
        """
        任务执行 ID。
        """
        return pulumi.get(self, "invocation_id")

    @property
    @pulumi.getter(name="invocationName")
    def invocation_name(self) -> builtins.str:
        """
        作业名称。不超过64个字符。暂不限制特殊字符。同地域下作业名称可重复。
        """
        return pulumi.get(self, "invocation_name")

    @property
    @pulumi.getter(name="invocationResults")
    def invocation_results(self) -> Sequence['outputs.GetInvocationInvocationResultResult']:
        """
        单台实例执行命令的结果。
        """
        return pulumi.get(self, "invocation_results")

    @property
    @pulumi.getter(name="invocationStatus")
    def invocation_status(self) -> builtins.str:
        """
        命令执行的总执行状态。
        """
        return pulumi.get(self, "invocation_status")

    @property
    @pulumi.getter(name="launchTime")
    def launch_time(self) -> builtins.str:
        """
        执行时间。
        """
        return pulumi.get(self, "launch_time")

    @property
    @pulumi.getter(name="parameterDefinitions")
    def parameter_definitions(self) -> Sequence['outputs.GetInvocationParameterDefinitionResult']:
        """
        任务触发时的命令自定义参数定义。
        """
        return pulumi.get(self, "parameter_definitions")

    @property
    @pulumi.getter
    def parameters(self) -> builtins.str:
        """
        命令中包含自定义参数时，需通过本参数传入自定义参数的键值对。自定义参数个数范围为0~60。Key不允许为空字符串，最多支持64个字符。Value允许为空字符串。自定义参数与原始命令内容在Base64编码后，综合长度不能超过16KB。设置的自定义参数名集合必须为创建命令时定义的参数集的子集。对于未传入的参数，使用默认值代替。
        """
        return pulumi.get(self, "parameters")

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> builtins.str:
        """
        资源所属项目，一个资源只能归属于一个项目。
        """
        return pulumi.get(self, "project_name")

    @property
    @pulumi.getter(name="recurrenceEndTime")
    def recurrence_end_time(self) -> builtins.str:
        """
        周期结束时间，仅适用于周期任务（Rate）。
        """
        return pulumi.get(self, "recurrence_end_time")

    @property
    @pulumi.getter(name="repeatMode")
    def repeat_mode(self) -> builtins.str:
        """
        设置命令执行的方式。Once：默认，表示立即执行命令。Rate：周期执行命令，需要通过Frequency参数传入Rate表达式指定执行周期。Fixed：定时执行命令，需要通过LaunchTime参数指定的执行时间。
        """
        return pulumi.get(self, "repeat_mode")

    @property
    @pulumi.getter(name="startTime")
    def start_time(self) -> builtins.str:
        """
        任务开始时间。
        """
        return pulumi.get(self, "start_time")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetInvocationTagResult']:
        """
        标签键值对。
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter
    def timeout(self) -> builtins.int:
        """
        创建的命令在ECS实例中执行时最大的超时时间，单位为秒。默认值：60。可选范围为：30~86400。
        """
        return pulumi.get(self, "timeout")

    @property
    @pulumi.getter
    def username(self) -> builtins.str:
        """
        在ECS实例中执行命令的用户名称。
        """
        return pulumi.get(self, "username")

    @property
    @pulumi.getter(name="windowsPassword")
    def windows_password(self) -> builtins.str:
        """
        自定义windows用户的密码。
        """
        return pulumi.get(self, "windows_password")

    @property
    @pulumi.getter(name="workingDir")
    def working_dir(self) -> builtins.str:
        """
        创建的命令在ECS实例中运行的目录。
        """
        return pulumi.get(self, "working_dir")


class AwaitableGetInvocationResult(GetInvocationResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetInvocationResult(
            command_content=self.command_content,
            command_description=self.command_description,
            command_id=self.command_id,
            command_name=self.command_name,
            command_provider=self.command_provider,
            command_type=self.command_type,
            enable_parameter=self.enable_parameter,
            end_time=self.end_time,
            frequency=self.frequency,
            id=self.id,
            instance_ids=self.instance_ids,
            instance_number=self.instance_number,
            invocation_description=self.invocation_description,
            invocation_id=self.invocation_id,
            invocation_name=self.invocation_name,
            invocation_results=self.invocation_results,
            invocation_status=self.invocation_status,
            launch_time=self.launch_time,
            parameter_definitions=self.parameter_definitions,
            parameters=self.parameters,
            project_name=self.project_name,
            recurrence_end_time=self.recurrence_end_time,
            repeat_mode=self.repeat_mode,
            start_time=self.start_time,
            tags=self.tags,
            timeout=self.timeout,
            username=self.username,
            windows_password=self.windows_password,
            working_dir=self.working_dir)


def get_invocation(id: Optional[builtins.str] = None,
                   opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetInvocationResult:
    """
    Data Source schema for Byteplus::ECS::Invocation


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:ecs/getInvocation:getInvocation', __args__, opts=opts, typ=GetInvocationResult).value

    return AwaitableGetInvocationResult(
        command_content=pulumi.get(__ret__, 'command_content'),
        command_description=pulumi.get(__ret__, 'command_description'),
        command_id=pulumi.get(__ret__, 'command_id'),
        command_name=pulumi.get(__ret__, 'command_name'),
        command_provider=pulumi.get(__ret__, 'command_provider'),
        command_type=pulumi.get(__ret__, 'command_type'),
        enable_parameter=pulumi.get(__ret__, 'enable_parameter'),
        end_time=pulumi.get(__ret__, 'end_time'),
        frequency=pulumi.get(__ret__, 'frequency'),
        id=pulumi.get(__ret__, 'id'),
        instance_ids=pulumi.get(__ret__, 'instance_ids'),
        instance_number=pulumi.get(__ret__, 'instance_number'),
        invocation_description=pulumi.get(__ret__, 'invocation_description'),
        invocation_id=pulumi.get(__ret__, 'invocation_id'),
        invocation_name=pulumi.get(__ret__, 'invocation_name'),
        invocation_results=pulumi.get(__ret__, 'invocation_results'),
        invocation_status=pulumi.get(__ret__, 'invocation_status'),
        launch_time=pulumi.get(__ret__, 'launch_time'),
        parameter_definitions=pulumi.get(__ret__, 'parameter_definitions'),
        parameters=pulumi.get(__ret__, 'parameters'),
        project_name=pulumi.get(__ret__, 'project_name'),
        recurrence_end_time=pulumi.get(__ret__, 'recurrence_end_time'),
        repeat_mode=pulumi.get(__ret__, 'repeat_mode'),
        start_time=pulumi.get(__ret__, 'start_time'),
        tags=pulumi.get(__ret__, 'tags'),
        timeout=pulumi.get(__ret__, 'timeout'),
        username=pulumi.get(__ret__, 'username'),
        windows_password=pulumi.get(__ret__, 'windows_password'),
        working_dir=pulumi.get(__ret__, 'working_dir'))
def get_invocation_output(id: Optional[pulumi.Input[builtins.str]] = None,
                          opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetInvocationResult]:
    """
    Data Source schema for Byteplus::ECS::Invocation


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:ecs/getInvocation:getInvocation', __args__, opts=opts, typ=GetInvocationResult)
    return __ret__.apply(lambda __response__: GetInvocationResult(
        command_content=pulumi.get(__response__, 'command_content'),
        command_description=pulumi.get(__response__, 'command_description'),
        command_id=pulumi.get(__response__, 'command_id'),
        command_name=pulumi.get(__response__, 'command_name'),
        command_provider=pulumi.get(__response__, 'command_provider'),
        command_type=pulumi.get(__response__, 'command_type'),
        enable_parameter=pulumi.get(__response__, 'enable_parameter'),
        end_time=pulumi.get(__response__, 'end_time'),
        frequency=pulumi.get(__response__, 'frequency'),
        id=pulumi.get(__response__, 'id'),
        instance_ids=pulumi.get(__response__, 'instance_ids'),
        instance_number=pulumi.get(__response__, 'instance_number'),
        invocation_description=pulumi.get(__response__, 'invocation_description'),
        invocation_id=pulumi.get(__response__, 'invocation_id'),
        invocation_name=pulumi.get(__response__, 'invocation_name'),
        invocation_results=pulumi.get(__response__, 'invocation_results'),
        invocation_status=pulumi.get(__response__, 'invocation_status'),
        launch_time=pulumi.get(__response__, 'launch_time'),
        parameter_definitions=pulumi.get(__response__, 'parameter_definitions'),
        parameters=pulumi.get(__response__, 'parameters'),
        project_name=pulumi.get(__response__, 'project_name'),
        recurrence_end_time=pulumi.get(__response__, 'recurrence_end_time'),
        repeat_mode=pulumi.get(__response__, 'repeat_mode'),
        start_time=pulumi.get(__response__, 'start_time'),
        tags=pulumi.get(__response__, 'tags'),
        timeout=pulumi.get(__response__, 'timeout'),
        username=pulumi.get(__response__, 'username'),
        windows_password=pulumi.get(__response__, 'windows_password'),
        working_dir=pulumi.get(__response__, 'working_dir')))
