%% WARNING: DO NOT EDIT, AUTO-GENERATED CODE! %% See https://github.com/aws-beam/aws-codegen for more details. %% @doc Amazon Elastic VMware Service (Amazon EVS) is a service that you can %% use to deploy a VMware Cloud Foundation (VCF) software environment %% directly on EC2 bare metal instances within an Amazon Virtual Private %% Cloud (VPC). %% %% Workloads running on Amazon EVS are fully compatible with workloads %% running on any standard VMware vSphere environment. This means that you %% can migrate any VMware-based workload to Amazon EVS without workload %% modification. -module(aws_evs). -export([associate_eip_to_vlan/2, associate_eip_to_vlan/3, create_entitlement/2, create_entitlement/3, create_environment/2, create_environment/3, create_environment_connector/2, create_environment_connector/3, create_environment_host/2, create_environment_host/3, delete_entitlement/2, delete_entitlement/3, delete_environment/2, delete_environment/3, delete_environment_connector/2, delete_environment_connector/3, delete_environment_host/2, delete_environment_host/3, disassociate_eip_from_vlan/2, disassociate_eip_from_vlan/3, get_depot_url/2, get_depot_url/3, get_environment/2, get_environment/3, get_versions/2, get_versions/3, list_environment_connectors/2, list_environment_connectors/3, list_environment_hosts/2, list_environment_hosts/3, list_environment_vlans/2, list_environment_vlans/3, list_environments/2, list_environments/3, list_tags_for_resource/2, list_tags_for_resource/3, list_vm_entitlements/2, list_vm_entitlements/3, tag_resource/2, tag_resource/3, untag_resource/2, untag_resource/3, update_environment_connector/2, update_environment_connector/3]). -include_lib("hackney/include/hackney_lib.hrl"). %% Example: %% vm_entitlement() :: #{ %% <<"connectorId">> => string(), %% <<"environmentId">> => string(), %% <<"errorDetail">> => error_detail(), %% <<"lastSyncedAt">> => [non_neg_integer()], %% <<"startedAt">> => [non_neg_integer()], %% <<"status">> => list(any()), %% <<"stoppedAt">> => [non_neg_integer()], %% <<"type">> => list(any()), %% <<"vmId">> => string(), %% <<"vmName">> => string() %% } -type vm_entitlement() :: #{binary() => any()}. %% Example: %% connector() :: #{ %% <<"applianceFqdn">> => string(), %% <<"checks">> => list(connector_check()), %% <<"connectorId">> => string(), %% <<"createdAt">> => [non_neg_integer()], %% <<"environmentId">> => string(), %% <<"modifiedAt">> => [non_neg_integer()], %% <<"secretArn">> => string(), %% <<"state">> => list(any()), %% <<"stateDetails">> => string(), %% <<"status">> => list(any()), %% <<"type">> => list(any()) %% } -type connector() :: #{binary() => any()}. %% Example: %% tag_resource_request() :: #{ %% <<"resourceArn">> := string(), %% <<"tags">> := map() %% } -type tag_resource_request() :: #{binary() => any()}. %% Example: %% check() :: #{ %% <<"impairedSince">> => [non_neg_integer()], %% <<"result">> => list(any()), %% <<"type">> => list(any()) %% } -type check() :: #{binary() => any()}. %% Example: %% associate_eip_to_vlan_request() :: #{ %% <<"allocationId">> := string(), %% <<"clientToken">> => string(), %% <<"environmentId">> := string(), %% <<"vlanName">> := [string()] %% } -type associate_eip_to_vlan_request() :: #{binary() => any()}. %% Example: %% update_environment_connector_request() :: #{ %% <<"applianceFqdn">> => string(), %% <<"clientToken">> => string(), %% <<"secretIdentifier">> => string() %% } -type update_environment_connector_request() :: #{binary() => any()}. %% Example: %% list_environment_hosts_response() :: #{ %% <<"environmentHosts">> => list(host()), %% <<"nextToken">> => string() %% } -type list_environment_hosts_response() :: #{binary() => any()}. %% Example: %% untag_resource_response() :: #{ %% } -type untag_resource_response() :: #{binary() => any()}. %% Example: %% list_environment_vlans_request() :: #{ %% <<"maxResults">> => integer(), %% <<"nextToken">> => string() %% } -type list_environment_vlans_request() :: #{binary() => any()}. %% Example: %% host_info_for_create() :: #{ %% <<"dedicatedHostId">> => string(), %% <<"hostName">> => string(), %% <<"instanceType">> => list(any()), %% <<"keyName">> => string(), %% <<"placementGroupId">> => string() %% } -type host_info_for_create() :: #{binary() => any()}. %% Example: %% connector_check() :: #{ %% <<"impairedSince">> => [non_neg_integer()], %% <<"lastCheckAttempt">> => [non_neg_integer()], %% <<"result">> => list(any()), %% <<"type">> => list(any()) %% } -type connector_check() :: #{binary() => any()}. %% Example: %% delete_environment_host_response() :: #{ %% <<"environmentSummary">> => environment_summary(), %% <<"host">> => host() %% } -type delete_environment_host_response() :: #{binary() => any()}. %% Example: %% environment_summary() :: #{ %% <<"createdAt">> => [non_neg_integer()], %% <<"environmentArn">> => string(), %% <<"environmentId">> => string(), %% <<"environmentName">> => string(), %% <<"environmentState">> => list(any()), %% <<"environmentStatus">> => list(any()), %% <<"modifiedAt">> => [non_neg_integer()], %% <<"vcfVersion">> => list(any()) %% } -type environment_summary() :: #{binary() => any()}. %% Example: %% get_environment_request() :: #{ %% } -type get_environment_request() :: #{binary() => any()}. %% Example: %% create_environment_host_request() :: #{ %% <<"clientToken">> => string(), %% <<"environmentId">> := string(), %% <<"esxVersion">> => string(), %% <<"host">> := host_info_for_create() %% } -type create_environment_host_request() :: #{binary() => any()}. %% Example: %% network_interface() :: #{ %% <<"networkInterfaceId">> => string() %% } -type network_interface() :: #{binary() => any()}. %% Example: %% initial_vlans() :: #{ %% <<"edgeVTep">> => initial_vlan_info(), %% <<"expansionVlan1">> => initial_vlan_info(), %% <<"expansionVlan2">> => initial_vlan_info(), %% <<"hcx">> => initial_vlan_info(), %% <<"hcxNetworkAclId">> => string(), %% <<"isHcxPublic">> => [boolean()], %% <<"nsxUplink">> => initial_vlan_info(), %% <<"vMotion">> => initial_vlan_info(), %% <<"vSan">> => initial_vlan_info(), %% <<"vTep">> => initial_vlan_info(), %% <<"vmManagement">> => initial_vlan_info(), %% <<"vmkManagement">> => initial_vlan_info() %% } -type initial_vlans() :: #{binary() => any()}. %% Example: %% initial_vlan_info() :: #{ %% <<"cidr">> => string() %% } -type initial_vlan_info() :: #{binary() => any()}. %% Example: %% list_environment_connectors_request() :: #{ %% <<"maxResults">> => integer(), %% <<"nextToken">> => string() %% } -type list_environment_connectors_request() :: #{binary() => any()}. %% Example: %% tag_policy_exception() :: #{ %% <<"message">> => [string()] %% } -type tag_policy_exception() :: #{binary() => any()}. %% Example: %% create_environment_connector_request() :: #{ %% <<"applianceFqdn">> := string(), %% <<"clientToken">> => string(), %% <<"secretIdentifier">> := string(), %% <<"type">> := list(any()) %% } -type create_environment_connector_request() :: #{binary() => any()}. %% Example: %% delete_entitlement_response() :: #{ %% <<"entitlements">> => list(vm_entitlement()) %% } -type delete_entitlement_response() :: #{binary() => any()}. %% Example: %% get_environment_response() :: #{ %% <<"environment">> => environment() %% } -type get_environment_response() :: #{binary() => any()}. %% Example: %% untag_resource_request() :: #{ %% <<"resourceArn">> := string(), %% <<"tagKeys">> := list(string()) %% } -type untag_resource_request() :: #{binary() => any()}. %% Example: %% vcf_version_info() :: #{ %% <<"defaultEsxVersion">> => [string()], %% <<"instanceTypes">> => list(list(any())()), %% <<"status">> => [string()], %% <<"vcfVersion">> => list(any()) %% } -type vcf_version_info() :: #{binary() => any()}. %% Example: %% service_access_security_groups() :: #{ %% <<"securityGroups">> => list(string()) %% } -type service_access_security_groups() :: #{binary() => any()}. %% Example: %% associate_eip_to_vlan_response() :: #{ %% <<"vlan">> => vlan() %% } -type associate_eip_to_vlan_response() :: #{binary() => any()}. %% Example: %% create_entitlement_response() :: #{ %% <<"entitlements">> => list(vm_entitlement()) %% } -type create_entitlement_response() :: #{binary() => any()}. %% Example: %% instance_type_esx_versions_info() :: #{ %% <<"esxVersions">> => list([string()]()), %% <<"instanceType">> => list(any()) %% } -type instance_type_esx_versions_info() :: #{binary() => any()}. %% Example: %% disassociate_eip_from_vlan_response() :: #{ %% <<"vlan">> => vlan() %% } -type disassociate_eip_from_vlan_response() :: #{binary() => any()}. %% Example: %% connectivity_info() :: #{ %% <<"privateRouteServerPeerings">> => list(string()) %% } -type connectivity_info() :: #{binary() => any()}. %% Example: %% resource_not_found_exception() :: #{ %% <<"message">> => [string()], %% <<"resourceId">> => [string()], %% <<"resourceType">> => [string()] %% } -type resource_not_found_exception() :: #{binary() => any()}. %% Example: %% environment() :: #{ %% <<"checks">> => list(check()), %% <<"connectivityInfo">> => connectivity_info(), %% <<"createdAt">> => [non_neg_integer()], %% <<"credentials">> => list(secret()), %% <<"environmentArn">> => string(), %% <<"environmentId">> => string(), %% <<"environmentName">> => string(), %% <<"environmentState">> => list(any()), %% <<"environmentStatus">> => list(any()), %% <<"kmsKeyId">> => [string()], %% <<"licenseInfo">> => list(license_info()), %% <<"modifiedAt">> => [non_neg_integer()], %% <<"serviceAccessSecurityGroups">> => service_access_security_groups(), %% <<"serviceAccessSubnetId">> => string(), %% <<"siteId">> => [string()], %% <<"stateDetails">> => string(), %% <<"termsAccepted">> => [boolean()], %% <<"vcfHostnames">> => vcf_hostnames(), %% <<"vcfVersion">> => list(any()), %% <<"vpcId">> => string() %% } -type environment() :: #{binary() => any()}. %% Example: %% service_quota_exceeded_exception() :: #{ %% <<"message">> => [string()] %% } -type service_quota_exceeded_exception() :: #{binary() => any()}. %% Example: %% list_vm_entitlements_response() :: #{ %% <<"entitlements">> => list(vm_entitlement()), %% <<"nextToken">> => string() %% } -type list_vm_entitlements_response() :: #{binary() => any()}. %% Example: %% create_environment_connector_response() :: #{ %% <<"connector">> => connector() %% } -type create_environment_connector_response() :: #{binary() => any()}. %% Example: %% secret() :: #{ %% <<"secretArn">> => [string()] %% } -type secret() :: #{binary() => any()}. %% Example: %% list_tags_for_resource_response() :: #{ %% <<"tags">> => map() %% } -type list_tags_for_resource_response() :: #{binary() => any()}. %% Example: %% list_environment_vlans_response() :: #{ %% <<"environmentVlans">> => list(vlan()), %% <<"nextToken">> => string() %% } -type list_environment_vlans_response() :: #{binary() => any()}. %% Example: %% list_environments_request() :: #{ %% <<"maxResults">> => integer(), %% <<"nextToken">> => string(), %% <<"state">> => list(list(any())()) %% } -type list_environments_request() :: #{binary() => any()}. %% Example: %% eip_association() :: #{ %% <<"allocationId">> => string(), %% <<"associationId">> => string(), %% <<"ipAddress">> => string() %% } -type eip_association() :: #{binary() => any()}. %% Example: %% validation_exception_field() :: #{ %% <<"message">> => [string()], %% <<"name">> => [string()] %% } -type validation_exception_field() :: #{binary() => any()}. %% Example: %% vcf_hostnames() :: #{ %% <<"cloudBuilder">> => string(), %% <<"nsx">> => string(), %% <<"nsxEdge1">> => string(), %% <<"nsxEdge2">> => string(), %% <<"nsxManager1">> => string(), %% <<"nsxManager2">> => string(), %% <<"nsxManager3">> => string(), %% <<"sddcManager">> => string(), %% <<"vCenter">> => string() %% } -type vcf_hostnames() :: #{binary() => any()}. %% Example: %% delete_environment_connector_response() :: #{ %% <<"connector">> => connector(), %% <<"environmentSummary">> => environment_summary() %% } -type delete_environment_connector_response() :: #{binary() => any()}. %% Example: %% license_info() :: #{ %% <<"solutionKey">> => string(), %% <<"vsanKey">> => string() %% } -type license_info() :: #{binary() => any()}. %% Example: %% host() :: #{ %% <<"createdAt">> => [non_neg_integer()], %% <<"dedicatedHostId">> => string(), %% <<"ec2InstanceId">> => [string()], %% <<"hostName">> => string(), %% <<"hostState">> => list(any()), %% <<"instanceType">> => list(any()), %% <<"ipAddress">> => string(), %% <<"keyName">> => string(), %% <<"modifiedAt">> => [non_neg_integer()], %% <<"networkInterfaces">> => list(network_interface()), %% <<"placementGroupId">> => string(), %% <<"stateDetails">> => string() %% } -type host() :: #{binary() => any()}. %% Example: %% list_environment_hosts_request() :: #{ %% <<"maxResults">> => integer(), %% <<"nextToken">> => string() %% } -type list_environment_hosts_request() :: #{binary() => any()}. %% Example: %% create_environment_response() :: #{ %% <<"environment">> => environment() %% } -type create_environment_response() :: #{binary() => any()}. %% Example: %% internal_server_exception() :: #{ %% <<"message">> => [string()] %% } -type internal_server_exception() :: #{binary() => any()}. %% Example: %% delete_environment_request() :: #{ %% <<"clientToken">> => string() %% } -type delete_environment_request() :: #{binary() => any()}. %% Example: %% delete_environment_connector_request() :: #{ %% <<"clientToken">> => string() %% } -type delete_environment_connector_request() :: #{binary() => any()}. %% Example: %% get_depot_url_response() :: #{ %% <<"depotUrl">> => [string()], %% <<"token">> => [string()] %% } -type get_depot_url_response() :: #{binary() => any()}. %% Example: %% error_detail() :: #{ %% <<"errorCode">> => [string()], %% <<"errorMessage">> => [string()] %% } -type error_detail() :: #{binary() => any()}. %% Example: %% disassociate_eip_from_vlan_request() :: #{ %% <<"associationId">> := string(), %% <<"clientToken">> => string(), %% <<"environmentId">> := string(), %% <<"vlanName">> := [string()] %% } -type disassociate_eip_from_vlan_request() :: #{binary() => any()}. %% Example: %% create_environment_host_response() :: #{ %% <<"environmentSummary">> => environment_summary(), %% <<"host">> => host() %% } -type create_environment_host_response() :: #{binary() => any()}. %% Example: %% tag_resource_response() :: #{ %% } -type tag_resource_response() :: #{binary() => any()}. %% Example: %% update_environment_connector_response() :: #{ %% <<"connector">> => connector() %% } -type update_environment_connector_response() :: #{binary() => any()}. %% Example: %% validation_exception() :: #{ %% <<"fieldList">> => list(validation_exception_field()), %% <<"message">> => [string()], %% <<"reason">> => list(any()) %% } -type validation_exception() :: #{binary() => any()}. %% Example: %% list_tags_for_resource_request() :: #{ %% <<"resourceArn">> := string() %% } -type list_tags_for_resource_request() :: #{binary() => any()}. %% Example: %% delete_entitlement_request() :: #{ %% <<"clientToken">> => string(), %% <<"connectorId">> := string(), %% <<"entitlementType">> := list(any()), %% <<"environmentId">> := string(), %% <<"vmIds">> := list(string()) %% } -type delete_entitlement_request() :: #{binary() => any()}. %% Example: %% throttling_exception() :: #{ %% <<"message">> => [string()], %% <<"retryAfterSeconds">> => [integer()] %% } -type throttling_exception() :: #{binary() => any()}. %% Example: %% list_environments_response() :: #{ %% <<"environmentSummaries">> => list(environment_summary()), %% <<"nextToken">> => string() %% } -type list_environments_response() :: #{binary() => any()}. %% Example: %% list_environment_connectors_response() :: #{ %% <<"connectors">> => list(connector()), %% <<"nextToken">> => string() %% } -type list_environment_connectors_response() :: #{binary() => any()}. %% Example: %% get_depot_url_request() :: #{ %% <<"rotate">> => [boolean()] %% } -type get_depot_url_request() :: #{binary() => any()}. %% Example: %% list_vm_entitlements_request() :: #{ %% <<"connectorId">> := string(), %% <<"entitlementType">> := list(any()), %% <<"environmentId">> := string(), %% <<"maxResults">> => integer(), %% <<"nextToken">> => string() %% } -type list_vm_entitlements_request() :: #{binary() => any()}. %% Example: %% create_environment_request() :: #{ %% <<"clientToken">> => string(), %% <<"connectivityInfo">> := connectivity_info(), %% <<"environmentName">> => string(), %% <<"hosts">> := list(host_info_for_create()), %% <<"initialVlans">> := initial_vlans(), %% <<"kmsKeyId">> => [string()], %% <<"licenseInfo">> := list(license_info()), %% <<"serviceAccessSecurityGroups">> => service_access_security_groups(), %% <<"serviceAccessSubnetId">> := string(), %% <<"siteId">> := [string()], %% <<"tags">> => map(), %% <<"termsAccepted">> := [boolean()], %% <<"vcfHostnames">> := vcf_hostnames(), %% <<"vcfVersion">> := list(any()), %% <<"vpcId">> := string() %% } -type create_environment_request() :: #{binary() => any()}. %% Example: %% get_versions_response() :: #{ %% <<"instanceTypeEsxVersions">> => list(instance_type_esx_versions_info()), %% <<"vcfVersions">> => list(vcf_version_info()) %% } -type get_versions_response() :: #{binary() => any()}. %% Example: %% vlan() :: #{ %% <<"availabilityZone">> => [string()], %% <<"cidr">> => string(), %% <<"createdAt">> => [non_neg_integer()], %% <<"eipAssociations">> => list(eip_association()), %% <<"functionName">> => [string()], %% <<"isPublic">> => [boolean()], %% <<"modifiedAt">> => [non_neg_integer()], %% <<"networkAclId">> => string(), %% <<"stateDetails">> => string(), %% <<"subnetId">> => string(), %% <<"vlanId">> => integer(), %% <<"vlanState">> => list(any()) %% } -type vlan() :: #{binary() => any()}. %% Example: %% get_versions_request() :: #{ %% } -type get_versions_request() :: #{binary() => any()}. %% Example: %% delete_environment_response() :: #{ %% <<"environment">> => environment() %% } -type delete_environment_response() :: #{binary() => any()}. %% Example: %% too_many_tags_exception() :: #{ %% <<"message">> => [string()] %% } -type too_many_tags_exception() :: #{binary() => any()}. %% Example: %% delete_environment_host_request() :: #{ %% <<"clientToken">> => string(), %% <<"environmentId">> := string(), %% <<"hostName">> := string() %% } -type delete_environment_host_request() :: #{binary() => any()}. %% Example: %% create_entitlement_request() :: #{ %% <<"clientToken">> => string(), %% <<"connectorId">> := string(), %% <<"entitlementType">> := list(any()), %% <<"environmentId">> := string(), %% <<"vmIds">> := list(string()) %% } -type create_entitlement_request() :: #{binary() => any()}. -type associate_eip_to_vlan_errors() :: throttling_exception() | validation_exception() | resource_not_found_exception(). -type create_entitlement_errors() :: throttling_exception() | validation_exception() | resource_not_found_exception(). -type create_environment_errors() :: validation_exception(). -type create_environment_connector_errors() :: throttling_exception() | validation_exception() | resource_not_found_exception(). -type create_environment_host_errors() :: throttling_exception() | validation_exception(). -type delete_entitlement_errors() :: throttling_exception() | validation_exception() | resource_not_found_exception(). -type delete_environment_errors() :: validation_exception() | resource_not_found_exception(). -type delete_environment_connector_errors() :: throttling_exception() | validation_exception() | resource_not_found_exception(). -type delete_environment_host_errors() :: validation_exception() | resource_not_found_exception(). -type disassociate_eip_from_vlan_errors() :: throttling_exception() | validation_exception() | resource_not_found_exception(). -type get_depot_url_errors() :: throttling_exception() | validation_exception() | resource_not_found_exception(). -type get_environment_errors() :: validation_exception() | resource_not_found_exception(). -type get_versions_errors() :: throttling_exception() | internal_server_exception(). -type list_environment_connectors_errors() :: validation_exception() | resource_not_found_exception(). -type list_environment_hosts_errors() :: validation_exception() | resource_not_found_exception(). -type list_environment_vlans_errors() :: validation_exception() | resource_not_found_exception(). -type list_environments_errors() :: validation_exception(). -type list_tags_for_resource_errors() :: resource_not_found_exception(). -type list_vm_entitlements_errors() :: validation_exception() | resource_not_found_exception(). -type tag_resource_errors() :: too_many_tags_exception() | service_quota_exceeded_exception() | resource_not_found_exception() | tag_policy_exception(). -type untag_resource_errors() :: resource_not_found_exception() | tag_policy_exception(). -type update_environment_connector_errors() :: throttling_exception() | validation_exception() | resource_not_found_exception(). %%==================================================================== %% API %%==================================================================== %% @doc Associates an Elastic IP address with a public HCX VLAN. %% %% This operation is only allowed for public HCX VLANs at this time. -spec associate_eip_to_vlan(aws_client:aws_client(), associate_eip_to_vlan_request()) -> {ok, associate_eip_to_vlan_response(), tuple()} | {error, any()} | {error, associate_eip_to_vlan_errors(), tuple()}. associate_eip_to_vlan(Client, Input) when is_map(Client), is_map(Input) -> associate_eip_to_vlan(Client, Input, []). -spec associate_eip_to_vlan(aws_client:aws_client(), associate_eip_to_vlan_request(), proplists:proplist()) -> {ok, associate_eip_to_vlan_response(), tuple()} | {error, any()} | {error, associate_eip_to_vlan_errors(), tuple()}. associate_eip_to_vlan(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"AssociateEipToVlan">>, Input, Options). %% @doc Creates a Windows Server License entitlement for virtual machines in %% an Amazon EVS environment using the provided vCenter Server connector. %% %% This is an asynchronous operation. Amazon EVS validates the specified %% virtual machines before starting usage tracking. -spec create_entitlement(aws_client:aws_client(), create_entitlement_request()) -> {ok, create_entitlement_response(), tuple()} | {error, any()} | {error, create_entitlement_errors(), tuple()}. create_entitlement(Client, Input) when is_map(Client), is_map(Input) -> create_entitlement(Client, Input, []). -spec create_entitlement(aws_client:aws_client(), create_entitlement_request(), proplists:proplist()) -> {ok, create_entitlement_response(), tuple()} | {error, any()} | {error, create_entitlement_errors(), tuple()}. create_entitlement(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"CreateEntitlement">>, Input, Options). %% @doc Creates an Amazon EVS environment that runs VCF software, such as %% SDDC Manager, NSX Manager, and vCenter Server. %% %% During environment creation, Amazon EVS performs validations on DNS %% settings, provisions VLAN subnets and hosts, and deploys the supplied %% version of VCF. %% %% It can take several hours to create an environment. After the deployment %% completes, you can configure VCF in the vSphere user interface according %% to your needs. %% %% When creating a new environment, the default ESX version for the selected %% VCF version will be used, you cannot choose a specific ESX version in %% `CreateEnvironment' action. When a host has been added with a specific %% ESX version, it can only be upgraded using vCenter Lifecycle Manager. %% %% You cannot use the `dedicatedHostId' and `placementGroupId' %% parameters together in the same `CreateEnvironment' action. This %% results in a `ValidationException' response. -spec create_environment(aws_client:aws_client(), create_environment_request()) -> {ok, create_environment_response(), tuple()} | {error, any()} | {error, create_environment_errors(), tuple()}. create_environment(Client, Input) when is_map(Client), is_map(Input) -> create_environment(Client, Input, []). -spec create_environment(aws_client:aws_client(), create_environment_request(), proplists:proplist()) -> {ok, create_environment_response(), tuple()} | {error, any()} | {error, create_environment_errors(), tuple()}. create_environment(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"CreateEnvironment">>, Input, Options). %% @doc Creates a connector for an Amazon EVS environment. %% %% A connector establishes a connection to a VCF appliance, such as vCenter, %% using a fully qualified domain name and an Amazon Web Services Secrets %% Manager secret that stores the appliance credentials. -spec create_environment_connector(aws_client:aws_client(), create_environment_connector_request()) -> {ok, create_environment_connector_response(), tuple()} | {error, any()} | {error, create_environment_connector_errors(), tuple()}. create_environment_connector(Client, Input) when is_map(Client), is_map(Input) -> create_environment_connector(Client, Input, []). -spec create_environment_connector(aws_client:aws_client(), create_environment_connector_request(), proplists:proplist()) -> {ok, create_environment_connector_response(), tuple()} | {error, any()} | {error, create_environment_connector_errors(), tuple()}. create_environment_connector(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"CreateEnvironmentConnector">>, Input, Options). %% @doc Creates an ESX host and adds it to an Amazon EVS environment. %% %% Amazon EVS supports 4-32 hosts per environment. %% %% This action can only be used after the Amazon EVS environment is deployed. %% %% You can use the `dedicatedHostId' parameter to specify an Amazon EC2 %% Dedicated Host for ESX host creation. %% %% You can use the `placementGroupId' parameter to specify a cluster or %% partition placement group to launch EC2 instances into. %% %% If you don't specify an ESX version when adding hosts using %% `CreateEnvironmentHost' action, Amazon EVS automatically uses the %% default ESX version associated with your environment's VCF version. To %% find the default ESX version for a particular VCF version, use the %% `GetVersions' action. %% %% You cannot use the `dedicatedHostId' and `placementGroupId' %% parameters together in the same `CreateEnvironmentHost' action. This %% results in a `ValidationException' response. -spec create_environment_host(aws_client:aws_client(), create_environment_host_request()) -> {ok, create_environment_host_response(), tuple()} | {error, any()} | {error, create_environment_host_errors(), tuple()}. create_environment_host(Client, Input) when is_map(Client), is_map(Input) -> create_environment_host(Client, Input, []). -spec create_environment_host(aws_client:aws_client(), create_environment_host_request(), proplists:proplist()) -> {ok, create_environment_host_response(), tuple()} | {error, any()} | {error, create_environment_host_errors(), tuple()}. create_environment_host(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"CreateEnvironmentHost">>, Input, Options). %% @doc Deletes a Windows Server License entitlement for virtual machines in %% an Amazon EVS environment. %% %% Deleting an entitlement stops usage tracking for the specified virtual %% machines. -spec delete_entitlement(aws_client:aws_client(), delete_entitlement_request()) -> {ok, delete_entitlement_response(), tuple()} | {error, any()} | {error, delete_entitlement_errors(), tuple()}. delete_entitlement(Client, Input) when is_map(Client), is_map(Input) -> delete_entitlement(Client, Input, []). -spec delete_entitlement(aws_client:aws_client(), delete_entitlement_request(), proplists:proplist()) -> {ok, delete_entitlement_response(), tuple()} | {error, any()} | {error, delete_entitlement_errors(), tuple()}. delete_entitlement(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"DeleteEntitlement">>, Input, Options). %% @doc Deletes an Amazon EVS environment. %% %% Amazon EVS environments will only be enabled for deletion once the hosts %% are deleted. You can delete hosts using the `DeleteEnvironmentHost' %% action. %% %% Environment deletion also deletes the associated Amazon EVS VLAN subnets %% and Amazon Web Services Secrets Manager secrets that Amazon EVS created. %% Amazon Web Services resources that you create are not deleted. These %% resources may continue to incur costs. -spec delete_environment(aws_client:aws_client(), delete_environment_request()) -> {ok, delete_environment_response(), tuple()} | {error, any()} | {error, delete_environment_errors(), tuple()}. delete_environment(Client, Input) when is_map(Client), is_map(Input) -> delete_environment(Client, Input, []). -spec delete_environment(aws_client:aws_client(), delete_environment_request(), proplists:proplist()) -> {ok, delete_environment_response(), tuple()} | {error, any()} | {error, delete_environment_errors(), tuple()}. delete_environment(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"DeleteEnvironment">>, Input, Options). %% @doc Deletes a connector from an Amazon EVS environment. %% %% Before deleting a connector, you must remove all entitlements that are %% associated with the same vCenter. -spec delete_environment_connector(aws_client:aws_client(), delete_environment_connector_request()) -> {ok, delete_environment_connector_response(), tuple()} | {error, any()} | {error, delete_environment_connector_errors(), tuple()}. delete_environment_connector(Client, Input) when is_map(Client), is_map(Input) -> delete_environment_connector(Client, Input, []). -spec delete_environment_connector(aws_client:aws_client(), delete_environment_connector_request(), proplists:proplist()) -> {ok, delete_environment_connector_response(), tuple()} | {error, any()} | {error, delete_environment_connector_errors(), tuple()}. delete_environment_connector(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"DeleteEnvironmentConnector">>, Input, Options). %% @doc Deletes a host from an Amazon EVS environment. %% %% Before deleting a host, you must unassign and decommission the host from %% within the SDDC Manager user interface. Not doing so could impact the %% availability of your virtual machines or result in data loss. -spec delete_environment_host(aws_client:aws_client(), delete_environment_host_request()) -> {ok, delete_environment_host_response(), tuple()} | {error, any()} | {error, delete_environment_host_errors(), tuple()}. delete_environment_host(Client, Input) when is_map(Client), is_map(Input) -> delete_environment_host(Client, Input, []). -spec delete_environment_host(aws_client:aws_client(), delete_environment_host_request(), proplists:proplist()) -> {ok, delete_environment_host_response(), tuple()} | {error, any()} | {error, delete_environment_host_errors(), tuple()}. delete_environment_host(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"DeleteEnvironmentHost">>, Input, Options). %% @doc Disassociates an Elastic IP address from a public HCX VLAN. %% %% This operation is only allowed for public HCX VLANs at this time. -spec disassociate_eip_from_vlan(aws_client:aws_client(), disassociate_eip_from_vlan_request()) -> {ok, disassociate_eip_from_vlan_response(), tuple()} | {error, any()} | {error, disassociate_eip_from_vlan_errors(), tuple()}. disassociate_eip_from_vlan(Client, Input) when is_map(Client), is_map(Input) -> disassociate_eip_from_vlan(Client, Input, []). -spec disassociate_eip_from_vlan(aws_client:aws_client(), disassociate_eip_from_vlan_request(), proplists:proplist()) -> {ok, disassociate_eip_from_vlan_response(), tuple()} | {error, any()} | {error, disassociate_eip_from_vlan_errors(), tuple()}. disassociate_eip_from_vlan(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"DisassociateEipFromVlan">>, Input, Options). %% @doc Returns a URL and authentication token for accessing the Amazon EVS %% Custom Addon depot. %% %% Configure the depot URL as a download source in vSphere Lifecycle Manager %% (vLCM) to sync and install the Amazon EVS Custom Addon. %% %% The depot URL remains active until you rotate the authentication token by %% calling this action with `rotate' set to `true'. -spec get_depot_url(aws_client:aws_client(), get_depot_url_request()) -> {ok, get_depot_url_response(), tuple()} | {error, any()} | {error, get_depot_url_errors(), tuple()}. get_depot_url(Client, Input) when is_map(Client), is_map(Input) -> get_depot_url(Client, Input, []). -spec get_depot_url(aws_client:aws_client(), get_depot_url_request(), proplists:proplist()) -> {ok, get_depot_url_response(), tuple()} | {error, any()} | {error, get_depot_url_errors(), tuple()}. get_depot_url(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"GetDepotUrl">>, Input, Options). %% @doc Returns a description of the specified environment. -spec get_environment(aws_client:aws_client(), get_environment_request()) -> {ok, get_environment_response(), tuple()} | {error, any()} | {error, get_environment_errors(), tuple()}. get_environment(Client, Input) when is_map(Client), is_map(Input) -> get_environment(Client, Input, []). -spec get_environment(aws_client:aws_client(), get_environment_request(), proplists:proplist()) -> {ok, get_environment_response(), tuple()} | {error, any()} | {error, get_environment_errors(), tuple()}. get_environment(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"GetEnvironment">>, Input, Options). %% @doc Returns information about VCF versions, ESX versions and EC2 instance %% types provided by Amazon EVS. %% %% For each VCF version, the response also includes the default ESX version %% and provided EC2 instance types. -spec get_versions(aws_client:aws_client(), get_versions_request()) -> {ok, get_versions_response(), tuple()} | {error, any()} | {error, get_versions_errors(), tuple()}. get_versions(Client, Input) when is_map(Client), is_map(Input) -> get_versions(Client, Input, []). -spec get_versions(aws_client:aws_client(), get_versions_request(), proplists:proplist()) -> {ok, get_versions_response(), tuple()} | {error, any()} | {error, get_versions_errors(), tuple()}. get_versions(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"GetVersions">>, Input, Options). %% @doc Lists the connectors within an environment. %% %% Returns the status of each connector and its applicable checks, among %% other connector details. -spec list_environment_connectors(aws_client:aws_client(), list_environment_connectors_request()) -> {ok, list_environment_connectors_response(), tuple()} | {error, any()} | {error, list_environment_connectors_errors(), tuple()}. list_environment_connectors(Client, Input) when is_map(Client), is_map(Input) -> list_environment_connectors(Client, Input, []). -spec list_environment_connectors(aws_client:aws_client(), list_environment_connectors_request(), proplists:proplist()) -> {ok, list_environment_connectors_response(), tuple()} | {error, any()} | {error, list_environment_connectors_errors(), tuple()}. list_environment_connectors(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"ListEnvironmentConnectors">>, Input, Options). %% @doc List the hosts within an environment. -spec list_environment_hosts(aws_client:aws_client(), list_environment_hosts_request()) -> {ok, list_environment_hosts_response(), tuple()} | {error, any()} | {error, list_environment_hosts_errors(), tuple()}. list_environment_hosts(Client, Input) when is_map(Client), is_map(Input) -> list_environment_hosts(Client, Input, []). -spec list_environment_hosts(aws_client:aws_client(), list_environment_hosts_request(), proplists:proplist()) -> {ok, list_environment_hosts_response(), tuple()} | {error, any()} | {error, list_environment_hosts_errors(), tuple()}. list_environment_hosts(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"ListEnvironmentHosts">>, Input, Options). %% @doc Lists environment VLANs that are associated with the specified %% environment. -spec list_environment_vlans(aws_client:aws_client(), list_environment_vlans_request()) -> {ok, list_environment_vlans_response(), tuple()} | {error, any()} | {error, list_environment_vlans_errors(), tuple()}. list_environment_vlans(Client, Input) when is_map(Client), is_map(Input) -> list_environment_vlans(Client, Input, []). -spec list_environment_vlans(aws_client:aws_client(), list_environment_vlans_request(), proplists:proplist()) -> {ok, list_environment_vlans_response(), tuple()} | {error, any()} | {error, list_environment_vlans_errors(), tuple()}. list_environment_vlans(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"ListEnvironmentVlans">>, Input, Options). %% @doc Lists the Amazon EVS environments in your Amazon Web Services account %% in the specified Amazon Web Services Region. -spec list_environments(aws_client:aws_client(), list_environments_request()) -> {ok, list_environments_response(), tuple()} | {error, any()} | {error, list_environments_errors(), tuple()}. list_environments(Client, Input) when is_map(Client), is_map(Input) -> list_environments(Client, Input, []). -spec list_environments(aws_client:aws_client(), list_environments_request(), proplists:proplist()) -> {ok, list_environments_response(), tuple()} | {error, any()} | {error, list_environments_errors(), tuple()}. list_environments(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"ListEnvironments">>, Input, Options). %% @doc Lists the tags for an Amazon EVS resource. -spec list_tags_for_resource(aws_client:aws_client(), list_tags_for_resource_request()) -> {ok, list_tags_for_resource_response(), tuple()} | {error, any()} | {error, list_tags_for_resource_errors(), tuple()}. list_tags_for_resource(Client, Input) when is_map(Client), is_map(Input) -> list_tags_for_resource(Client, Input, []). -spec list_tags_for_resource(aws_client:aws_client(), list_tags_for_resource_request(), proplists:proplist()) -> {ok, list_tags_for_resource_response(), tuple()} | {error, any()} | {error, list_tags_for_resource_errors(), tuple()}. list_tags_for_resource(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"ListTagsForResource">>, Input, Options). %% @doc Lists the Windows Server License entitlements for virtual machines in %% an Amazon EVS environment. %% %% Returns existing entitlements for virtual machines associated with the %% specified environment and connector. -spec list_vm_entitlements(aws_client:aws_client(), list_vm_entitlements_request()) -> {ok, list_vm_entitlements_response(), tuple()} | {error, any()} | {error, list_vm_entitlements_errors(), tuple()}. list_vm_entitlements(Client, Input) when is_map(Client), is_map(Input) -> list_vm_entitlements(Client, Input, []). -spec list_vm_entitlements(aws_client:aws_client(), list_vm_entitlements_request(), proplists:proplist()) -> {ok, list_vm_entitlements_response(), tuple()} | {error, any()} | {error, list_vm_entitlements_errors(), tuple()}. list_vm_entitlements(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"ListVmEntitlements">>, Input, Options). %% @doc Associates the specified tags to an Amazon EVS resource with the %% specified `resourceArn'. %% %% If existing tags on a resource are not specified in the request %% parameters, they aren't changed. When a resource is deleted, the tags %% associated with that resource are also deleted. Tags that you create for %% Amazon EVS resources don't propagate to any other resources associated %% with the environment. For example, if you tag an environment with this %% operation, that tag doesn't automatically propagate to the VLAN %% subnets and hosts associated with the environment. -spec tag_resource(aws_client:aws_client(), tag_resource_request()) -> {ok, tag_resource_response(), tuple()} | {error, any()} | {error, tag_resource_errors(), tuple()}. tag_resource(Client, Input) when is_map(Client), is_map(Input) -> tag_resource(Client, Input, []). -spec tag_resource(aws_client:aws_client(), tag_resource_request(), proplists:proplist()) -> {ok, tag_resource_response(), tuple()} | {error, any()} | {error, tag_resource_errors(), tuple()}. tag_resource(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"TagResource">>, Input, Options). %% @doc Deletes specified tags from an Amazon EVS resource. -spec untag_resource(aws_client:aws_client(), untag_resource_request()) -> {ok, untag_resource_response(), tuple()} | {error, any()} | {error, untag_resource_errors(), tuple()}. untag_resource(Client, Input) when is_map(Client), is_map(Input) -> untag_resource(Client, Input, []). -spec untag_resource(aws_client:aws_client(), untag_resource_request(), proplists:proplist()) -> {ok, untag_resource_response(), tuple()} | {error, any()} | {error, untag_resource_errors(), tuple()}. untag_resource(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"UntagResource">>, Input, Options). %% @doc Updates a connector for an Amazon EVS environment. %% %% You can update the Amazon Web Services Secrets Manager secret ARN or the %% appliance FQDN to reconfigure the connector metadata. %% %% You cannot update both the secret and the FQDN in the same request. -spec update_environment_connector(aws_client:aws_client(), update_environment_connector_request()) -> {ok, update_environment_connector_response(), tuple()} | {error, any()} | {error, update_environment_connector_errors(), tuple()}. update_environment_connector(Client, Input) when is_map(Client), is_map(Input) -> update_environment_connector(Client, Input, []). -spec update_environment_connector(aws_client:aws_client(), update_environment_connector_request(), proplists:proplist()) -> {ok, update_environment_connector_response(), tuple()} | {error, any()} | {error, update_environment_connector_errors(), tuple()}. update_environment_connector(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"UpdateEnvironmentConnector">>, Input, Options). %%==================================================================== %% Internal functions %%==================================================================== -spec request(aws_client:aws_client(), binary(), map(), list()) -> {ok, Result, {integer(), list(), hackney:client()}} | {error, Error, {integer(), list(), hackney:client()}} | {error, term()} when Result :: map() | undefined, Error :: map(). request(Client, Action, Input, Options) -> RequestFun = fun() -> do_request(Client, Action, Input, Options) end, aws_request:request(RequestFun, Options). do_request(Client, Action, Input0, Options) -> Client1 = Client#{service => <<"evs">>}, DefaultHost = build_host(<<"evs">>, Client1), {URL, Host} = aws_util:apply_endpoint_url_override(build_url(DefaultHost, Client1), DefaultHost, <<"/">>, <<"AWS_ENDPOINT_URL_AWS_EVS">>), Headers = [ {<<"Host">>, Host}, {<<"Content-Type">>, <<"application/x-amz-json-1.0">>}, {<<"X-Amz-Target">>, <<"AmazonElasticVMwareService.", Action/binary>>} ], Input = Input0, Payload = jsx:encode(Input), SignedHeaders = aws_request:sign_request(Client1, <<"POST">>, URL, Headers, Payload), Response = hackney:request(post, URL, SignedHeaders, Payload, Options), handle_response(Response). handle_response({ok, 200, ResponseHeaders, Client}) -> case hackney:body(Client) of {ok, <<>>} -> {ok, undefined, {200, ResponseHeaders, Client}}; {ok, Body} -> Result = jsx:decode(Body), {ok, Result, {200, ResponseHeaders, Client}} end; handle_response({ok, StatusCode, ResponseHeaders, Client}) -> {ok, Body} = hackney:body(Client), Error = jsx:decode(Body), {error, Error, {StatusCode, ResponseHeaders, Client}}; handle_response({error, Reason}) -> {error, Reason}. build_host(_EndpointPrefix, #{region := <<"local">>, endpoint := Endpoint}) -> Endpoint; build_host(_EndpointPrefix, #{region := <<"local">>}) -> <<"localhost">>; build_host(EndpointPrefix, #{region := Region, endpoint := Endpoint}) -> aws_util:binary_join([EndpointPrefix, Region, Endpoint], <<".">>). build_url(Host, Client) -> Proto = aws_client:proto(Client), Port = aws_client:port(Client), aws_util:binary_join([Proto, <<"://">>, Host, <<":">>, Port, <<"/">>], <<"">>).