Skip to main content

Build Status License semantic-release

IBM Cloud Virtual Private Cloud (VPC) Python SDK Version 0.35.0

Python client library to interact with various IBM Cloud Virtual Private Cloud (VPC) Service APIs.

This SDK uses Semantic Versioning, and as such there may be backward-incompatible changes for any new 0.y.z version.

Table of Contents

Overview

The IBM Cloud Virtual Private Cloud (VPC) Python SDK allows developers to programmatically interact with the following IBM Cloud services:

Service Name Imported Class Name
VPC VpcV1

Prerequisites

  • An IBM Cloud account.
  • An IAM API key to allow the SDK to access your account. Create an apikey here.
  • Python version 3.10 or above.

Installation

To install, use pip or easy_install:

pip install --upgrade "ibm-vpc>=0.35.0"

or

easy_install --upgrade "ibm-vpc>=0.35.0"

Using the SDK

For general SDK usage information, see the IBM Cloud SDK Common README.

Setting up VPC service

from ibm_vpc import VpcV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_cloud_sdk_core import ApiException

authenticator = IAMAuthenticator("YOUR_IBMCLOUD_API_KEY")
service = VpcV1(authenticator=authenticator)

# to change the service URL to the United Kingdom region
service.set_service_url(VpcV1.get_service_url_for_region("eu-gb"))

#  Listing VPCs
print("List VPCs")
try:
    vpcs = service.list_vpcs().get_result()['vpcs']
except ApiException as e:
  print("List VPC failed with status code " + str(e.code) + ": " + e.message)
for vpc in vpcs:
    print(vpc['id'], "\t",  vpc['name'])

#  Listing Subnets
print("List Subnets")
try:
    subnets = service.list_subnets().get_result()['subnets']
except ApiException as e:
  print("List subnets failed with status code " + str(e.code) + ": " + e.message)
for subnet in subnets:
    print(subnet['id'], "\t",  subnet['name'])

#  Listing Instances
print("List Instances")
try:
    instances = service.list_instances().get_result()['instances']
except ApiException as e:
  print("List instances failed with status code " + str(e.code) + ": " + e.message)
for instance in instances:
    print(instance['id'], "\t",  instance['name'])

instanceId = instances[0]['id']
instanceName = instances[0]['name']

#  Updating Instance
print("Updated Instance")
try:
    newInstanceName = instanceName + "-1"
    instance = service.update_instance(
        id=instanceId,
        name=newInstanceName,
    ).get_result()
except ApiException as e:
    print("Update instance failed with status code " + str(e.code) + ": " + e.message)
print(instance['id'], "\t",  instance['name'])

Questions

If you have difficulties using this SDK or you have a question about the IBM Cloud services, ask a question at Stack Overflow.

Issues

If you encounter an issue with the project, you are welcome to submit a bug report. Before you create a new issue, search for similar issues. It's possible that someone has already reported the problem.

Open source @ IBM

Find more open source projects on the IBM GitHub Page.

Contributing

See CONTRIBUTING.

License

This SDK is released under the Apache 2.0 license. The license's full text can be found in LICENSE.

Release files for ibm-vpc 0.35.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ibm-vpc 0.35.0
File Size Uploaded
ibm_vpc-0.35.0.tar.gz 635.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ibm-vpc 0.35.0
File Interpreter ABI Platform
ibm_vpc-0.35.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / ibm_vpc-0.35.0.tar.gz

Download URL ibm_vpc-0.35.0.tar.gz
Size 635.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7d3b2b4c2aaa0105db1c5d000041845a2a0eebbdcd5bedc34ce2fbafc949ce77
BLAKE2b-256 checksum
How to use checksums
4df827c53ec266d9e10b3f535bb1dd45d12a7ebb44606678ecb0800265a73abe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / ibm_vpc-0.35.0-py3-none-any.whl

Download URL ibm_vpc-0.35.0-py3-none-any.whl
Size 653.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55f50a1578825532143484fb932f08bc34c3dc35645394183e4080517b326cbc
BLAKE2b-256 checksum
How to use checksums
1ffc129283c6e825c12bc72d2a9ab930607d67cc18673281f6cfe7848ec4a677
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

0.35.1

2 release files

This release

0.35.0 This release

2 release files

0.32.0

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.29.1

2 release files

0.29.0

2 release files

0.28.1

2 release files

0.28.0

2 release files

0.27.0

2 release files

0.25.0

1 release file

0.24.1

1 release file

0.23.0

1 release file

0.22.0

1 release file

0.21.0

1 release file

0.20.0

1 release file

0.19.1

1 release file

0.19.0

1 release file

0.18.0

1 release file

0.17.0

1 release file

0.16.0

1 release file

0.15.0

1 release file

0.14.0

1 release file

0.13.0

1 release file

0.12.0

1 release file

0.11.1

1 release file

0.11.0

1 release file

0.10.0

1 release file

0.9.0

1 release file

0.8.0

1 release file

0.7.0

1 release file

0.6.0

1 release file

0.5.1

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page