Delete a private connection

This document describes how to delete a private connection using the Google Cloud console. When you delete a private connection, you delete all the components of the private connection, including all of the private connection configurations. If you want to keep any of the data, back up the data to on-premises storage or other storage.

gcloud and API requirements

To use the gcloud command line tool or the API to manage your VMware Engine resources, we recommend configuring the tools as described below.

gcloud

  1. Set your default project ID:

    gcloud config set project PROJECT_ID
    
  2. Set a default region and/or zone:

    gcloud config set compute/region REGION
    gcloud config set compute/zone ZONE

For more information on the gcloud vmware tool, reviewing the Cloud SDK reference docs.

API

API examples in this documentation set use the cURL command-line tool to query the API. A valid access token is required as part of the cURL request. There are many ways to get a valid access token; the following steps use the gcloud tool to generate a access token:

  1. Login to Google Cloud

    gcloud auth login
    
  2. Generate access token and export to TOKEN

    export TOKEN=`gcloud auth print-access-token`
    
  3. Verify that TOKEN is set properly

    echo $TOKEN
    
    Output:
    TOKEN
    

Now, use the authorization token in your requests to the API. For example:

curl -X GET -H "Authorization: Bearer \"$TOKEN\""  -H "Content-Type: application/json; charset=utf-8" https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations

Python

Python code samples in this documentation use the VMware Engine library to communicate with the API. To be able to use this approach, the library needs to be installed and the Application Default Credentials should be configured.

  1. Download and install the Python library

     pip install google-cloud-vmwareengine
    
  2. Configure the ADC information by executing those command in your shell

      gcloud auth application-default login
    

    or use a Service Account key file

      export GOOGLE_APPLICATION_CREDENTIALS="FILE_PATH"
    

For more information about the library, visit the reference page or view code samples on GitHub.

Delete a private connection

To delete a private connection using the Google Cloud CLI or VMware Engine API, do the following:

gcloud

Delete a private connection by running the gcloud vmware private-connections delete command:

  gcloud vmware private-connections delete PRIVATE_CONNECTION_ID 
--location=REGION

Replace the following:

  • PRIVATE_CONNECTION_ID: the private connection ID for this request.
  • REGION: the region to delete this private connection in.

API

To delete a private connection using the VMware Engine API, make a DELETE request:

  DELETE "https://vmwareengine.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/privateConnections/PRIVATE_CONNECTION_ID"

Replace the following:

  • PROJECT_ID: the project name for this request.
  • REGION: the region to delete this private connection in.
  • PRIVATE_CONNECTION_ID: the private connection ID for this request.