Skip to content

Credential type

CredentialEnumParameter

Bases: CredentialParameter

Parameters:

Name Type Description Default
key str

Used to identify the parameter.

required
values list[Union[str, tuple[str, str]]]

An array containing all enum values. If 'default' is specified and not part of this array, it will be added as an additional enum value. Enum values are not localizable.

required
label Optional[str]

Label that is displayed in the VMware Aria Operations UI. Defaults to the key.

None
default Optional[str]

The default value of the enum.

None
required bool

True if user is required to provide this parameter. Defaults to True.

True
display_order int

Determines the order parameters will be displayed in the UI.

0
Source code in lib/python/src/aria/ops/definition/credential_type.py
class CredentialEnumParameter(CredentialParameter):
    """
    Args:
        key (str): Used to identify the parameter.
        values (list[Union[str, tuple[str,str]]]): An array containing all enum values. If 'default' is specified and
            not part of this array, it will be added as an additional enum value. Enum values are not localizable.
        label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
        default (Optional[str]): The default value of the enum.
        required (bool): True if user is required to provide this parameter. Defaults to True.
        display_order (int): Determines the order parameters will be displayed in the UI.
    """

    def __init__(
        self,
        key: str,
        values: list[Union[str, tuple[str, str]]],
        label: Optional[str] = None,
        default: Optional[str] = None,
        required: bool = True,
        display_order: int = 0,
    ):
        super().__init__(key, label, required, display_order)
        self.values = values
        self.default = default

        if (
            default not in [v[0] if isinstance(v, tuple) else v for v in self.values]
            and default is not None
        ):
            self.values.append((default, default))

    def to_json(self) -> dict:
        return super().to_json() | {
            "type": "string",
            "default": self.default,
            "enum": True,
            "enum_values": [
                {
                    "key": str(value[0]) if isinstance(value, tuple) else value,
                    "label": str(value[1]) if isinstance(value, tuple) else value,
                    "display_order": display_order,
                }
                for display_order, value in enumerate(self.values)
            ],
        }

CredentialIntParameter

Bases: CredentialParameter

Parameters:

Name Type Description Default
key str

Used to identify the parameter.

required
label Optional[str]

Label that is displayed in the VMware Aria Operations UI. Defaults to the key.

None
required bool

True if user is required to provide this parameter. Defaults to True.

True
display_order int

Determines the order parameters will be displayed in the UI.

0
Source code in lib/python/src/aria/ops/definition/credential_type.py
class CredentialIntParameter(CredentialParameter):
    """
    Args:
        key (str): Used to identify the parameter.
        label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
        required (bool): True if user is required to provide this parameter. Defaults to True.
        display_order (int): Determines the order parameters will be displayed in the UI.
    """

    def __init__(
        self,
        key: str,
        label: Optional[str] = None,
        required: bool = True,
        display_order: int = 0,
    ):
        super().__init__(key, label, required, display_order)

    def to_json(self) -> dict:
        return super().to_json() | {
            "type": "integer",
        }

CredentialParameter

Bases: ABC

Source code in lib/python/src/aria/ops/definition/credential_type.py
class CredentialParameter(ABC):
    def __init__(
        self,
        key: str,
        label: Optional[str] = None,
        required: bool = True,
        display_order: int = 0,
    ):
        """
        Args:
            key (str): Used to identify the parameter.
            label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
            required (bool): True if user is required to provide this parameter. Defaults to True.
            display_order (0): Determines the order parameters will be displayed in the UI.
        """
        self.key = validate_key(key, "Credential parameter")
        self.label = label
        if label is None:
            self.label = key
        self.required = required
        self.display_order = display_order

    def to_json(self) -> dict:
        return {
            "key": self.key,
            "label": self.label,
            "required": self.required,
            "password": False,
            "enum": False,
            "display_order": self.display_order,
        }

__init__(key, label=None, required=True, display_order=0)

Parameters:

Name Type Description Default
key str

Used to identify the parameter.

required
label Optional[str]

Label that is displayed in the VMware Aria Operations UI. Defaults to the key.

None
required bool

True if user is required to provide this parameter. Defaults to True.

True
display_order 0

Determines the order parameters will be displayed in the UI.

0
Source code in lib/python/src/aria/ops/definition/credential_type.py
def __init__(
    self,
    key: str,
    label: Optional[str] = None,
    required: bool = True,
    display_order: int = 0,
):
    """
    Args:
        key (str): Used to identify the parameter.
        label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
        required (bool): True if user is required to provide this parameter. Defaults to True.
        display_order (0): Determines the order parameters will be displayed in the UI.
    """
    self.key = validate_key(key, "Credential parameter")
    self.label = label
    if label is None:
        self.label = key
    self.required = required
    self.display_order = display_order

CredentialPasswordParameter

Bases: CredentialParameter

Source code in lib/python/src/aria/ops/definition/credential_type.py
class CredentialPasswordParameter(CredentialParameter):
    def __init__(
        self,
        key: str,
        label: Optional[str] = None,
        required: bool = True,
        display_order: int = 0,
    ):
        """
        Args:
            key (str): Used to identify the parameter.
            label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
            required (bool): True if user is required to provide this parameter. Defaults to True.
            display_order (int): Determines the order parameters will be displayed in the UI.
        """
        super().__init__(key, label, required, display_order)

    def to_json(self) -> dict:
        return super().to_json() | {
            "type": "string",
            "password": True,
        }

__init__(key, label=None, required=True, display_order=0)

Parameters:

Name Type Description Default
key str

Used to identify the parameter.

required
label Optional[str]

Label that is displayed in the VMware Aria Operations UI. Defaults to the key.

None
required bool

True if user is required to provide this parameter. Defaults to True.

True
display_order int

Determines the order parameters will be displayed in the UI.

0
Source code in lib/python/src/aria/ops/definition/credential_type.py
def __init__(
    self,
    key: str,
    label: Optional[str] = None,
    required: bool = True,
    display_order: int = 0,
):
    """
    Args:
        key (str): Used to identify the parameter.
        label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
        required (bool): True if user is required to provide this parameter. Defaults to True.
        display_order (int): Determines the order parameters will be displayed in the UI.
    """
    super().__init__(key, label, required, display_order)

CredentialStringParameter

Bases: CredentialParameter

Source code in lib/python/src/aria/ops/definition/credential_type.py
class CredentialStringParameter(CredentialParameter):
    def __init__(
        self,
        key: str,
        label: Optional[str] = None,
        required: bool = True,
        display_order: int = 0,
    ):
        """
        Args:
            key (str): Used to identify the parameter.
            label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
            required (bool): True if user is required to provide this parameter. Defaults to True.
            display_order (int): Determines the order parameters will be displayed in the UI.
        """
        super().__init__(key, label, required, display_order)

    def to_json(self) -> dict:
        return super().to_json() | {
            "type": "string",
        }

__init__(key, label=None, required=True, display_order=0)

Parameters:

Name Type Description Default
key str

Used to identify the parameter.

required
label Optional[str]

Label that is displayed in the VMware Aria Operations UI. Defaults to the key.

None
required bool

True if user is required to provide this parameter. Defaults to True.

True
display_order int

Determines the order parameters will be displayed in the UI.

0
Source code in lib/python/src/aria/ops/definition/credential_type.py
def __init__(
    self,
    key: str,
    label: Optional[str] = None,
    required: bool = True,
    display_order: int = 0,
):
    """
    Args:
        key (str): Used to identify the parameter.
        label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
        required (bool): True if user is required to provide this parameter. Defaults to True.
        display_order (int): Determines the order parameters will be displayed in the UI.
    """
    super().__init__(key, label, required, display_order)

CredentialType

Source code in lib/python/src/aria/ops/definition/credential_type.py
class CredentialType:
    def __init__(self, key: str, label: Optional[str] = None):
        self.key = validate_key(key, "Credential type")
        self.label = label
        if label is None:
            self.label = key
        self.credential_parameters: dict = OrderedDict()

    def define_string_parameter(
        self, key: str, label: Optional[str] = None, required: bool = True
    ) -> CredentialStringParameter:
        """
        Create a new string credential parameter and apply it to this credential definition.

        Args:
            key (str): Used to identify the parameter.
            label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
            required (bool): True if user is required to provide this parameter. Defaults to True.

        Returns:
             The created string parameter definition.
        """
        field = CredentialStringParameter(key, label, required)
        self.add_parameter(field)
        return field

    def define_int_parameter(
        self, key: str, label: Optional[str] = None, required: bool = True
    ) -> CredentialIntParameter:
        """
        Create a new int credential parameter and apply it to this credential definition.

        Args:
            key (str): Used to identify the parameter.
            label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
            required (bool): True if user is required to provide this parameter. Defaults to True.

        Returns:
             The created int parameter definition.
        """
        field = CredentialIntParameter(key, label, required)
        self.add_parameter(field)
        return field

    def define_password_parameter(
        self, key: str, label: Optional[str] = None, required: bool = True
    ) -> CredentialPasswordParameter:
        """
        Create a new password credential parameter and apply it to this credential definition.

        Args:
            key (str): Used to identify the parameter.
            label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
            required (bool): True if user is required to provide this parameter. Defaults to True.

        Returns:
            The created password parameter definition.
        """
        field = CredentialPasswordParameter(key, label, required)
        self.add_parameter(field)
        return field

    def define_enum_parameter(
        self,
        key: str,
        values: list[Union[str, tuple[str, str]]],
        label: Optional[str] = None,
        default: Optional[str] = None,
        required: bool = True,
    ) -> CredentialEnumParameter:
        """
        Create a new enum credential parameter and apply it to this credential definition.

        Args:
            key (str): Used to identify the parameter.
            values (list[Union[str, tuple[str, str]]]): An array containing all enum values. If 'default' is specified
                and not part of this array, it will be added as an additional enum value. Enum values are not localizable.
            label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
            default (Optional[str]): The default value of the enum.
            required (bool): True if user is required to provide this parameter. Defaults to True.

        Returns:
             The created enum parameter definition.
        """
        field = CredentialEnumParameter(key, values, label, default, required)
        self.add_parameter(field)
        return field

    def add_parameters(self, credential_parameters: list[CredentialParameter]) -> None:
        """
        Args:
            credential_parameters (list[CredentialParameter]): A list of parameters to add to the credential
        """
        for credential_parameter in credential_parameters:
            self.add_parameter(credential_parameter)

    def add_parameter(self, credential_parameter: CredentialParameter) -> None:
        """
        Args:
            credential_parameter (CredentialParameter): The parameter to add to the credential
        """
        key = credential_parameter.key
        if key in self.credential_parameters:
            raise DuplicateKeyException(
                f"Credential field with key {key} already exists in adapter definition."
            )
        credential_parameter.display_order = len(self.credential_parameters)
        self.credential_parameters[key] = credential_parameter

    def to_json(self) -> dict:
        return {
            "key": self.key,
            "label": self.label,
            "fields": [
                field.to_json() for field in self.credential_parameters.values()
            ],
        }

add_parameter(credential_parameter)

Parameters:

Name Type Description Default
credential_parameter CredentialParameter

The parameter to add to the credential

required
Source code in lib/python/src/aria/ops/definition/credential_type.py
def add_parameter(self, credential_parameter: CredentialParameter) -> None:
    """
    Args:
        credential_parameter (CredentialParameter): The parameter to add to the credential
    """
    key = credential_parameter.key
    if key in self.credential_parameters:
        raise DuplicateKeyException(
            f"Credential field with key {key} already exists in adapter definition."
        )
    credential_parameter.display_order = len(self.credential_parameters)
    self.credential_parameters[key] = credential_parameter

add_parameters(credential_parameters)

Parameters:

Name Type Description Default
credential_parameters list[CredentialParameter]

A list of parameters to add to the credential

required
Source code in lib/python/src/aria/ops/definition/credential_type.py
def add_parameters(self, credential_parameters: list[CredentialParameter]) -> None:
    """
    Args:
        credential_parameters (list[CredentialParameter]): A list of parameters to add to the credential
    """
    for credential_parameter in credential_parameters:
        self.add_parameter(credential_parameter)

define_enum_parameter(key, values, label=None, default=None, required=True)

Create a new enum credential parameter and apply it to this credential definition.

Parameters:

Name Type Description Default
key str

Used to identify the parameter.

required
values list[Union[str, tuple[str, str]]]

An array containing all enum values. If 'default' is specified and not part of this array, it will be added as an additional enum value. Enum values are not localizable.

required
label Optional[str]

Label that is displayed in the VMware Aria Operations UI. Defaults to the key.

None
default Optional[str]

The default value of the enum.

None
required bool

True if user is required to provide this parameter. Defaults to True.

True

Returns:

Type Description
CredentialEnumParameter

The created enum parameter definition.

Source code in lib/python/src/aria/ops/definition/credential_type.py
def define_enum_parameter(
    self,
    key: str,
    values: list[Union[str, tuple[str, str]]],
    label: Optional[str] = None,
    default: Optional[str] = None,
    required: bool = True,
) -> CredentialEnumParameter:
    """
    Create a new enum credential parameter and apply it to this credential definition.

    Args:
        key (str): Used to identify the parameter.
        values (list[Union[str, tuple[str, str]]]): An array containing all enum values. If 'default' is specified
            and not part of this array, it will be added as an additional enum value. Enum values are not localizable.
        label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
        default (Optional[str]): The default value of the enum.
        required (bool): True if user is required to provide this parameter. Defaults to True.

    Returns:
         The created enum parameter definition.
    """
    field = CredentialEnumParameter(key, values, label, default, required)
    self.add_parameter(field)
    return field

define_int_parameter(key, label=None, required=True)

Create a new int credential parameter and apply it to this credential definition.

Parameters:

Name Type Description Default
key str

Used to identify the parameter.

required
label Optional[str]

Label that is displayed in the VMware Aria Operations UI. Defaults to the key.

None
required bool

True if user is required to provide this parameter. Defaults to True.

True

Returns:

Type Description
CredentialIntParameter

The created int parameter definition.

Source code in lib/python/src/aria/ops/definition/credential_type.py
def define_int_parameter(
    self, key: str, label: Optional[str] = None, required: bool = True
) -> CredentialIntParameter:
    """
    Create a new int credential parameter and apply it to this credential definition.

    Args:
        key (str): Used to identify the parameter.
        label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
        required (bool): True if user is required to provide this parameter. Defaults to True.

    Returns:
         The created int parameter definition.
    """
    field = CredentialIntParameter(key, label, required)
    self.add_parameter(field)
    return field

define_password_parameter(key, label=None, required=True)

Create a new password credential parameter and apply it to this credential definition.

Parameters:

Name Type Description Default
key str

Used to identify the parameter.

required
label Optional[str]

Label that is displayed in the VMware Aria Operations UI. Defaults to the key.

None
required bool

True if user is required to provide this parameter. Defaults to True.

True

Returns:

Type Description
CredentialPasswordParameter

The created password parameter definition.

Source code in lib/python/src/aria/ops/definition/credential_type.py
def define_password_parameter(
    self, key: str, label: Optional[str] = None, required: bool = True
) -> CredentialPasswordParameter:
    """
    Create a new password credential parameter and apply it to this credential definition.

    Args:
        key (str): Used to identify the parameter.
        label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
        required (bool): True if user is required to provide this parameter. Defaults to True.

    Returns:
        The created password parameter definition.
    """
    field = CredentialPasswordParameter(key, label, required)
    self.add_parameter(field)
    return field

define_string_parameter(key, label=None, required=True)

Create a new string credential parameter and apply it to this credential definition.

Parameters:

Name Type Description Default
key str

Used to identify the parameter.

required
label Optional[str]

Label that is displayed in the VMware Aria Operations UI. Defaults to the key.

None
required bool

True if user is required to provide this parameter. Defaults to True.

True

Returns:

Type Description
CredentialStringParameter

The created string parameter definition.

Source code in lib/python/src/aria/ops/definition/credential_type.py
def define_string_parameter(
    self, key: str, label: Optional[str] = None, required: bool = True
) -> CredentialStringParameter:
    """
    Create a new string credential parameter and apply it to this credential definition.

    Args:
        key (str): Used to identify the parameter.
        label (Optional[str]): Label that is displayed in the VMware Aria Operations UI. Defaults to the key.
        required (bool): True if user is required to provide this parameter. Defaults to True.

    Returns:
         The created string parameter definition.
    """
    field = CredentialStringParameter(key, label, required)
    self.add_parameter(field)
    return field