# Create an environment.

Endpoint: POST /environments
Version: 3.17.0
Security: ApiKeyAuth

## Security:

  - `ApiKeyAuth` (unknown)
    apiKey in header Authorization

## Request body:

  - `application/json` (unknown)
    The parameters to create an environment.

## Request fields (application/json):

  - `name` (string)
    The name of the environment.
    Example: oracle-environment

  - `engine_id` (string, required)
    The ID of the Engine onto which to create the environment.
    Example: 12

  - `os_name` (string, required)
    Operating system type of the environment.
    Enum: "UNIX", "WINDOWS"

  - `is_cluster` (boolean)
    Whether the environment to be created is a cluster.
    Example: true

  - `cluster_home` (string)
    Absolute path to cluster home drectory. This parameter is mandatory for UNIX cluster environments.
    Example: /u01/app/19.0.0.0/grid

  - `hostname` (string, required)
    host address of the machine.
    Example: db.host.com

  - `staging_environment` (string)
    Id of the connector environment which is used to connect to this source environment. This is mandatory parameter when creating Windows source environments.
    Example: 1-WINDOWS_HOST-1

  - `connector_port` (integer)
    Specify port on which Delphix connector will run. This is mandatory parameter when creating Windows target environments.
    Example: 9100

  - `connector_authentication_key` (string)
    Unique per Delphix key used to authenticate with the remote Delphix Connector.
    Example: secret

  - `is_target` (boolean)
    Whether the environment to be created is a target cluster environment. This property is used only when creating Windows cluster environments.
    Example: true

  - `ssh_port` (integer)
    ssh port of the host.
    Example: 22

  - `toolkit_path` (string)
    The path for the toolkit that resides on the host.
    Example: /work

  - `username` (string)
    Username of the OS.
    Example: oracle

  - `password` (string)
    Password of the OS.
    Example: oracle

  - `vault` (string)
    The name or reference of the vault from which to read the host credentials.
    Example: my-vault

  - `vault_username` (string)
    Delphix display name for the vault user
    Example: my-vault-user

  - `hashicorp_vault_engine` (string)
    Vault engine name where the credential is stored.
    Example: kv

  - `hashicorp_vault_secret_path` (string)
    Path in the vault engine where the credential is stored.
    Example: oracle-env

  - `hashicorp_vault_username_key` (string)
    Key for the username in the key-value store.
    Example: username

  - `hashicorp_vault_secret_key` (string)
    Key for the password in the key-value store.
    Example: secret

  - `cyberark_vault_query_string` (string)
    Query to find a credential in the CyberArk vault.
    Example: Safe=Test;Folder=Test;Object=Test

  - `azure_vault_name` (string)
    Azure key vault name.
    Example: azure_vault

  - `azure_vault_username_key` (string)
    Azure vault key for the username in the key-value store.
    Example: username

  - `azure_vault_secret_key` (string)
    Azure vault key for the password in the key-value store.
    Example: secret

  - `use_kerberos_authentication` (boolean)
    Whether to use kerberos authentication.
    Example: true

  - `use_engine_public_key` (boolean)
    Whether to use public key authentication.
    Example: true

  - `nfs_addresses` (array)
    array of ip address or hostnames
    Example: ["192.168.10.2"]

  - `ase_db_vault_username` (string)
    Delphix display name for the vault user
    Example: user-123

  - `ase_db_username` (string)
    username of the SAP ASE database.
    Example: user-123

  - `ase_db_password` (string)
    password of the SAP ASE database.
    Example: test

  - `ase_db_vault` (string)
    The name or reference of the vault from which to read the ASE database credentials.
    Example: my-vault

  - `ase_db_hashicorp_vault_engine` (string)
    Vault engine name where the credential is stored.
    Example: kv

  - `ase_db_hashicorp_vault_secret_path` (string)
    Path in the vault engine where the credential is stored.
    Example: oracle-env

  - `ase_db_hashicorp_vault_username_key` (string)
    Key for the username in the key-value store.
    Example: username

  - `ase_db_hashicorp_vault_secret_key` (string)
    Key for the password in the key-value store.
    Example: secret

  - `ase_db_cyberark_vault_query_string` (string)
    Query to find a credential in the CyberArk vault.
    Example: Safe=Test;Folder=Test;Object=Test

  - `ase_db_use_kerberos_authentication` (boolean)
    Whether to use kerberos authentication for ASE DB discovery.
    Example: true

  - `ase_db_azure_vault_name` (string)
    Azure key vault name.
    Example: azure_vault

  - `ase_db_azure_vault_username_key` (string)
    Azure vault key for the username in the key-value store.
    Example: username

  - `ase_db_azure_vault_secret_key` (string)
    Azure vault key for the password in the key-value store.
    Example: secret

  - `java_home` (string)
    The path to the user managed Java Development Kit (JDK). If not specified, then the OpenJDK will be used.
    Example: /Library/Java/JavaVirtualMachines/jdk/Contents/Home

  - `dsp_keystore_path` (string)
    DSP keystore path.
    Example: /tmp/keystore.keystore

  - `dsp_keystore_password` (string)
    DSP keystore password.
    Example: temp123

  - `dsp_keystore_alias` (string)
    DSP keystore alias.
    Example: oracle-src

  - `dsp_truststore_path` (string)
    DSP truststore path.
    Example: /tmp/truststore.keystore

  - `dsp_truststore_password` (string)
    DSP truststore password.
    Example: truststore123

  - `description` (string)
    The environment description.
    Example: Unix Orcale source host

  - `tags` (array)
    The tags to be created for this environment.

  - `tags.key` (string, required)
    Key of the tag
    Example: key-1

  - `tags.value` (string, required)
    Value of the tag
    Example: value-1

  - `make_current_account_owner` (boolean)
    Whether the account creating this environment must be configured as owner of the environment.

## Request examples:

  - `Unix - Standalone Environments` (unknown)
    The request example is intended for creating Unix standalone environments.

  - `Windows - Standalone Target Environments` (unknown)
    The request example is intended for creating Windows standalone target environments.

  - `Windows - Standalone Source Environments` (unknown)
    The request example is intended for creating Windows standalone source environments.

  - `Unix - Cluster Environments` (unknown)
    The request example is intended for creating Unix cluster environments.

  - `Windows - Source Cluster Environments` (unknown)
    The request example is intended for creating Windows source cluster environments.

  - `Windows - Target Cluster Environments` (unknown)
    The request example is intended for creating Windows target cluster environments.

## Response 201:

  - `201` (unknown)
    Environment creation initiated

## Response 201 fields (application/json):

  - `job` (object)
    An asynchronous task.

  - `job.id` (string)
    The Job entity ID.
    Example: job-123

  - `job.status` (string)
    The status of the job.
    Enum: "PENDING", "STARTED", "TIMEDOUT", "RUNNING", "CANCELED", "FAILED", "SUSPENDED", "WAITING", "COMPLETED", "ABANDONED"

  - `job.is_waiting_for_telemetry` (boolean)
    Indicates that the operations performed by this Job have completed successfully, but the object changes are not yet reflected. This is only set when when the JOB is in STARTED status, with the guarantee that the job will not transition to the FAILED status. Note that this flag will likely be replaced with a new status in future API versions and be deprecated.

  - `job.type` (string)
    The type of job being done.
    Example: DB_REFRESH

  - `job.localized_type` (string)
    The i18n translated type of job being done.
    Example: DB Refresh

  - `job.error_details` (string)
    Details about the failure for FAILED jobs.
    Example: Unable to connect to the engine.

  - `job.warning_message` (string)
    Warnings for the job.
    Example: Failed to remove local MaskingJob, engineId: 3 localMaskingJobId: 7.

  - `job.target_id` (string)
    A reference to the job's target.
    Example: vdb-123

  - `job.target_name` (string)
    A reference to the job's target name.
    Example: vdb

  - `job.start_time` (string)
    The time the job started executing.
    Example: 2022-01-02T05:11:24.148Z

  - `job.update_time` (string)
    The time the job was last updated.
    Example: 2022-01-02T06:11:24.148Z

  - `job.trace_id` (string)
    traceId of the request which created this Job

  - `job.engine_ids` (array)
    IDs of the engines this Job is executing on.

  - `job.tags` (array)

  - `job.tags.key` (string, required)
    Key of the tag
    Example: key-1

  - `job.tags.value` (string, required)
    Value of the tag
    Example: value-1

  - `job.engines` (array)

  - `job.engines.engine_id` (string)

  - `job.engines.engine_name` (string)

  - `job.account_id` (integer)
    The ID of the account who initiated this job.
    Example: 1

  - `job.account_name` (string)
    The account name which initiated this job. It can be either firstname and lastname combination or firstname or lastname or username or email address or Account-.
    Example: User 1

  - `job.percent_complete` (integer)
    Completion percentage of the Job.
    Example: 50

  - `job.virtualization_tasks` (array)

  - `job.virtualization_tasks.id` (string)

  - `job.virtualization_tasks.parent_job_id` (string)

  - `job.virtualization_tasks.start_time` (string)

  - `job.virtualization_tasks.end_time` (string)

  - `job.virtualization_tasks.title` (string)

  - `job.virtualization_tasks.percent_complete` (integer)

  - `job.virtualization_tasks.events` (array)

  - `job.virtualization_tasks.events.message_details` (string)

  - `job.virtualization_tasks.status` (string)
    Enum: "PENDING", "STARTED", "TIMEDOUT", "RUNNING", "CANCELED", "FAILED", "SUSPENDED", "WAITING", "COMPLETED", "ABANDONED"

  - `job.tasks` (array)

  - `job.tasks.id` (string)

  - `job.tasks.parent_job_id` (string)

  - `job.tasks.start_time` (string)

  - `job.tasks.end_time` (string)

  - `job.tasks.title` (string)

  - `job.tasks.percent_complete` (integer)

  - `job.tasks.events` (array)

  - `job.tasks.events.message_details` (string)

  - `job.tasks.status` (string)
    Enum: "PENDING", "STARTED", "TIMEDOUT", "RUNNING", "CANCELED", "FAILED", "SUSPENDED", "WAITING", "COMPLETED", "ABANDONED"

  - `job.execution_id` (string)
    The ID of the associated masking execution, if any.

  - `environment_id` (string)
    The id of environment created.
    Example: host-environment-1

