Skip to content

Commit 2723e20

Browse files
authored
feat(2021-06-29): Update SDK to use VPC API version 2021-06-29 (#25)
* feat(2021-06-29): Update SDK to use VPC API version 2021-05-29 * fix(build): fixing tox.ini
1 parent 432a2d5 commit 2723e20

16 files changed

+15603
-85902
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ matrix:
1212
- python: 3.6
1313
- python: 3.7
1414
- python: 3.8
15+
- python: 3.9
1516

1617
before_install:
1718
- npm install npm@latest -g
1819
- sudo apt-get update
1920
- sudo apt-get install pandoc
2021
- pip install pypandoc
21-
- '[ "${TRAVIS_PULL_REQUEST}" == "false" ] && openssl aes-256-cbc -K $encrypted_9d748cee9f61_key -iv $encrypted_9d748cee9f61_iv -in vpc.env.enc -out vpc.env -d || true'
2222

2323
install:
2424
- pip install tox-travis

Makefile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# This makefile is used to make it easier to get the project set up
2-
# to be ready for development work in the local sandbox.
3-
# example: "make setup"
4-
51
setup: deps dev_deps install
62

73
deps:
@@ -16,8 +12,5 @@ install:
1612
unit-test:
1713
pytest -v test/unit
1814

19-
test-int-gen1:
20-
pytest -v test/integration/test_gen1.py --capture=tee-sys
21-
22-
test-int-gen2:
23-
pytest -v test/integration/test_gen2.py --capture=tee-sys
15+
test-int:
16+
pytest -v test/integration --capture=tee-sys

README.md

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Python client library to interact with various [IBM Cloud Virtual Private Cloud
88

99
This SDK uses [Semantic Versioning](https://semver.org), and as such there may be backward-incompatible changes for any new `0.y.z` version.
1010

11-
**Note** As IBM continues to invest and innovate on the IBM Cloud Virtual Private Cloud (gen 2 compute) infrastructure, we're focusing on delivering maximum value in a single VPC Infrastructure platform. To support this effort, generation 1 compute infrastructure is being deprecated. The end of service date is 26 February 2021. For more information, see the [Start your migration](https://www.ibm.com/cloud/blog/announcements/start-your-vpc-gen1-to-vpc-gen2-migration) blog.
1211

1312
## Table of Contents
1413

@@ -29,7 +28,6 @@ This SDK uses [Semantic Versioning](https://semver.org), and as such there may b
2928
- [Installation](#installation)
3029
- [Using the SDK](#using-the-sdk)
3130
- [Setting up VPC service](#setting-up-vpc-service)
32-
- [Setting up VPC on Classic service](#setting-up-vpc-on-classic-service)
3331
- [Questions](#questions)
3432
- [Issues](#issues)
3533
- [Open source @ IBM](#open-source--ibm)
@@ -46,7 +44,6 @@ IBM Cloud services:
4644
Service Name | Imported Class Name
4745
--- | ---
4846
[VPC](https://cloud.ibm.com/apidocs/vpc) | VpcV1
49-
[VPC Gen 1](https://cloud.ibm.com/apidocs/vpc-on-classic) | VpcClassicV1
5047

5148
## Prerequisites
5249

@@ -127,60 +124,6 @@ print(instance['id'], "\t", instance['name'])
127124
```
128125

129126

130-
## Setting up VPC on Classic service
131-
```python
132-
from ibm_vpc import VpcClassicV1
133-
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
134-
from ibm_cloud_sdk_core import ApiException
135-
136-
authenticator = IAMAuthenticator("YOUR_IBMCLOUD_API_KEY")
137-
service = VpcClassicV1('2020-06-02', authenticator=authenticator)
138-
139-
# Listing VPCs
140-
print("List VPCs")
141-
try:
142-
vpcs = service.list_vpcs().get_result()['vpcs']
143-
except ApiException as e:
144-
print("List VPC failed with status code " + str(e.code) + ": " + e.message)
145-
for vpc in vpcs:
146-
print(vpc['id'], "\t", vpc['name'])
147-
print("\n")
148-
149-
# Listing Subnets
150-
print("List Subnets")
151-
try:
152-
subnets = service.list_subnets().get_result()['subnets']
153-
except ApiException as e:
154-
print("List subnets failed with status code " + str(e.code) + ": " + e.message)
155-
for subnet in subnets:
156-
print(subnet['id'], "\t", subnet['name'])
157-
158-
# Listing Instances
159-
print("List Instances")
160-
try:
161-
instances = service.list_instances().get_result()['instances']
162-
except ApiException as e:
163-
print("List instances failed with status code " + str(e.code) + ": " + e.message)
164-
for instance in instances:
165-
print(instance['id'], "\t", instance['name'])
166-
167-
instanceId = instances[0]['id']
168-
instanceName = instances[0]['name']
169-
170-
# Updating Instance
171-
print("Updated Instance")
172-
try:
173-
newInstanceName = instanceName + "-1"
174-
instance = service.update_instance(
175-
id=instanceId,
176-
name=newInstanceName,
177-
).get_result()
178-
except ApiException as e:
179-
print("Update instance failed with status code " + str(e.code) + ": " + e.message)
180-
print(instance['id'], "\t", instance['name'])
181-
182-
```
183-
184127
## Questions
185128

186129
If you are having difficulties using this SDK or have a question about the IBM Cloud services,

ibm_vpc/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@
1919

2020
from .common import get_sdk_headers
2121
from .version import __version__
22-
from .vpc_classic_v1 import VpcClassicV1
2322
from .vpc_v1 import VpcV1

0 commit comments

Comments
 (0)