Skip to content

Commit cbd7517

Browse files
authored
Releasing version 2.2.15
Releasing version 2.2.15
2 parents b4c1cfc + b420e99 commit cbd7517

26 files changed

+1612
-102
lines changed

CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on `Keep a Changelog <http://keepachangelog.com/>`_.
66

7+
====================
8+
2.2.15 - 2019-06-25
9+
====================
10+
11+
Added
12+
-----
13+
* Support for moving senders across compartments in the Email service
14+
* Support for moving NAT gateway resources across compartments in Core Services
15+
716
====================
817
2.2.14 - 2019-06-18
918
====================

docs/api/core.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Core Services
5252
oci.core.models.CaptureConsoleHistoryDetails
5353
oci.core.models.ChangeBootVolumeBackupCompartmentDetails
5454
oci.core.models.ChangeBootVolumeCompartmentDetails
55+
oci.core.models.ChangeNatGatewayCompartmentDetails
5556
oci.core.models.ChangeServiceGatewayCompartmentDetails
5657
oci.core.models.ChangeVolumeBackupCompartmentDetails
5758
oci.core.models.ChangeVolumeCompartmentDetails
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ChangeNatGatewayCompartmentDetails
2+
==================================
3+
4+
.. currentmodule:: oci.core.models
5+
6+
.. autoclass:: ChangeNatGatewayCompartmentDetails
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:

docs/api/email.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Email
1818
:nosignatures:
1919
:template: autosummary/model_class.rst
2020

21+
oci.email.models.ChangeSenderCompartmentDetails
2122
oci.email.models.CreateSenderDetails
2223
oci.email.models.CreateSuppressionDetails
2324
oci.email.models.Sender
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ChangeSenderCompartmentDetails
2+
==============================
3+
4+
.. currentmodule:: oci.email.models
5+
6+
.. autoclass:: ChangeSenderCompartmentDetails
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# coding: utf-8
2+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
3+
4+
# This sample will create the VCN where the NAT Gateway will be created, and create the NAT Gateway that
5+
# will be moved to a new compartment. Cleanup of NAT gateway and VCN is performed after completion of
6+
# the change compartment operation.
7+
#
8+
# This script takes the following arguments
9+
#
10+
# * The OCID of the compartment where the NAT gateway and related resources will be created
11+
# * TThe OCID of the compartment where the NAT gateway will be moved to
12+
#
13+
# Usage :
14+
# change_nat_gateway_compartment_example.py --src-compartment-id=<src compartment OCID>
15+
# --dest-compartment-id=<dest compartment OCID>
16+
#
17+
#
18+
19+
import argparse
20+
import oci
21+
from oci.core import VirtualNetworkClient
22+
from oci.core import VirtualNetworkClientCompositeOperations
23+
from oci.core.models import ChangeNatGatewayCompartmentDetails
24+
from oci.core.models import CreateNatGatewayDetails
25+
from oci.core.models import CreateVcnDetails
26+
from oci.core.models import Vcn
27+
from oci.core.models import NatGateway
28+
29+
nat_gateway_id = None
30+
src_compartment_id = None
31+
dest_compartment_id = None
32+
virtual_network_client = None
33+
virtual_network_client_composite_ops = None
34+
vcn_id = None
35+
36+
37+
# Sets up the service client used to perform the operations
38+
def setup_client():
39+
global virtual_network_client
40+
global virtual_network_client_composite_ops
41+
42+
# read oci config
43+
config = oci.config.from_file()
44+
45+
# Create Virtual Network Client with configuration
46+
virtual_network_client = VirtualNetworkClient(config)
47+
48+
# Create Virtual Network Client with configuration for composite operations
49+
virtual_network_client_composite_ops = VirtualNetworkClientCompositeOperations(virtual_network_client)
50+
51+
52+
# Creates VCN and waits for it to become available
53+
def create_vcn():
54+
global virtual_network_client_composite_ops
55+
global vcn_id
56+
57+
# setup create vcn details
58+
create_vcn_details = CreateVcnDetails()
59+
create_vcn_details.cidr_block = '10.0.0.0/16'
60+
create_vcn_details.compartment_id = src_compartment_id
61+
create_vcn_details.display_name = 'test_change_nat_gateway'
62+
63+
# create vcn
64+
response = virtual_network_client_composite_ops.create_vcn_and_wait_for_state(create_vcn_details, wait_for_states=[Vcn.LIFECYCLE_STATE_AVAILABLE])
65+
vcn_id = response.data.id
66+
print("Created Vcn: " + vcn_id)
67+
print("")
68+
69+
70+
# Creates NAT Gateway and waits for it to become available
71+
def create_nat_gateway():
72+
global virtual_network_client_composite_ops
73+
global nat_gateway_id
74+
global vcn_id
75+
76+
print("Creating NAT Gateway")
77+
print("=======================================")
78+
# setup create nat gateway details
79+
create_ngw_details = CreateNatGatewayDetails()
80+
create_ngw_details.vcn_id = vcn_id
81+
create_ngw_details.compartment_id = src_compartment_id
82+
create_ngw_details.display_name = 'test_change_nat_gateway'
83+
84+
# create ngw
85+
response = virtual_network_client_composite_ops.create_nat_gateway_and_wait_for_state(create_ngw_details, wait_for_states=[NatGateway.LIFECYCLE_STATE_AVAILABLE])
86+
nat_gateway_id = response.data.id
87+
88+
print("Created NAT Gateway and waited for it to become available %s" % response.data)
89+
print("")
90+
print("")
91+
92+
93+
# Changes the compartment of the NAT Gateway
94+
def change_nat_gateway_compartment():
95+
global virtual_network_client
96+
global dest_compartment_id
97+
global nat_gateway_id
98+
print("Changing NAT Gateway's compartment")
99+
print("=======================================")
100+
# setup change compartment details
101+
change_compartment_details = ChangeNatGatewayCompartmentDetails()
102+
change_compartment_details.compartment_id = dest_compartment_id
103+
104+
virtual_network_client.change_nat_gateway_compartment(nat_gateway_id, change_compartment_details)
105+
changedNatGateway = get_nat_gateway()
106+
print("NAT Gateway's compartment has been changed: %s" % changedNatGateway.data)
107+
print("")
108+
print("")
109+
110+
111+
# Gets the NAT Gateway
112+
def get_nat_gateway():
113+
global virtual_network_client
114+
global nat_gateway_id
115+
116+
response = virtual_network_client.get_nat_gateway(nat_gateway_id)
117+
return response
118+
119+
120+
# Deletes the NAT Gateway and waits for it to become terminated
121+
def delete_nat_gateway():
122+
global virtual_network_client_composite_ops
123+
global nat_gateway_id
124+
125+
virtual_network_client_composite_ops.delete_nat_gateway_and_wait_for_state(nat_gateway_id, wait_for_states=[NatGateway.LIFECYCLE_STATE_TERMINATED])
126+
127+
128+
# Deletes the VCN and waits for it to become terminated
129+
def delete_vcn():
130+
global virtual_network_client_composite_ops
131+
global vcn_id
132+
133+
virtual_network_client_composite_ops.delete_vcn_and_wait_for_state(vcn_id, wait_for_states=[Vcn.LIFECYCLE_STATE_TERMINATED])
134+
135+
136+
# Parses the command line
137+
def parse_command_line():
138+
global src_compartment_id
139+
global dest_compartment_id
140+
141+
# parse arguments
142+
parser = argparse.ArgumentParser()
143+
parser.add_argument('--src-compartment-id',
144+
help='source compartment ID in which to create and change nat gateway from',
145+
required=True
146+
)
147+
parser.add_argument('--dest-compartment-id',
148+
help='destination compartment ID where the nat gateway should be moved',
149+
required=True
150+
)
151+
args = parser.parse_args()
152+
src_compartment_id = args.src_compartment_id
153+
dest_compartment_id = args.dest_compartment_id
154+
155+
156+
def perform_change_compartment():
157+
global nat_gateway_id
158+
global vcn_id
159+
160+
try:
161+
print("")
162+
print("Performing operations to change NAT Gateway compartment from %s to %s" % (src_compartment_id, dest_compartment_id))
163+
print("")
164+
setup_client()
165+
# A VCN is required to create a NAT Gateway
166+
create_vcn()
167+
# Here we demonstrate:
168+
#
169+
# - Creating a NAT gateway
170+
# - Changing the NAT gateway's compartment
171+
#
172+
# And we'll delete these resources when we're done
173+
#
174+
create_nat_gateway()
175+
change_nat_gateway_compartment()
176+
177+
except Exception as e:
178+
print("[ERROR]: Error during change nat gateway example execution : %s" % e)
179+
finally:
180+
print("Clean Up")
181+
print("===========")
182+
if nat_gateway_id:
183+
delete_nat_gateway()
184+
print("Deleted NAT Gateway")
185+
if vcn_id:
186+
delete_vcn()
187+
print("Deleted VCN")
188+
189+
190+
if __name__ == '__main__':
191+
parse_command_line()
192+
perform_change_compartment()

examples/email_service_example.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
# This script provides a basic example of how to use the Email Service in the Python SDK. This script accepts two
55
# will demonstrate:
66
#
7-
# * Creating, retrieving, listing and deleting email senders
7+
# * Creating, retrieving, moving, listing and deleting email senders
88
# * Creating, retrieving, listing and deleting email suppressions
99
# * Obtaining SMTP credentials for your IAM user so that you can send emails.
1010
# See https://docs.cloud.oracle.com/Content/Email/Tasks/configuresmtpconnection.htm for more
1111
# information on sending emails
1212
#
13-
# This script accepts three arguments:
13+
# This script accepts four arguments:
1414
#
1515
# * The compartment ID where email senders will be created
16+
# * The target compartment ID where email senders will be moved to
1617
# * The address of the email sender
1718
# * The address of the email suppression
1819
#
@@ -27,13 +28,14 @@
2728
email_client = oci.email.EmailClient(config)
2829
identity_client = oci.identity.IdentityClient(config)
2930

30-
if len(sys.argv) != 4:
31-
raise RuntimeError('This script expects an argument of a compartment OCID, sender email address and suppression email address')
31+
if len(sys.argv) != 5:
32+
raise RuntimeError('This script expects an argument of a compartment OCID, a target compartment OCID, sender email address and suppression email address')
3233

3334
# The first argument is the name of the script, so start the index at 1
3435
compartment_id = sys.argv[1]
35-
sender_address = sys.argv[2]
36-
suppression_address = sys.argv[3]
36+
target_compartment_id = sys.argv[2]
37+
sender_address = sys.argv[3]
38+
suppression_address = sys.argv[4]
3739

3840
create_sender_response = email_client.create_sender(
3941
oci.email.models.CreateSenderDetails(
@@ -49,6 +51,16 @@
4951
print('Waited for sender to become available:\n{}'.format(get_sender_response.data))
5052
print('\n=========================\n')
5153

54+
# change sender compartment
55+
change_sender_response = email_client.change_sender_compartment(
56+
create_sender_response.data.id,
57+
oci.email.models.ChangeSenderCompartmentDetails(
58+
compartment_id=target_compartment_id
59+
)
60+
)
61+
print('Moved sender:\n{}'.format(create_sender_response.data.id))
62+
print('\n=========================\n')
63+
5264
# We can list all senders, and also provide optional filters and sorts. Here we'll list all
5365
# senders sorted by their email address, and also demonstrate filtering by sender email
5466
# address (an exact match filter)

examples/showoci/CHANGELOG.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on `Keep a Changelog <http://keepachangelog.com/>`_.
66

7+
====================
8+
19.6.24 - 2019-06-24
9+
====================
10+
Added
11+
-----
12+
* Added Freeform Tags and Defined Tages to the Compute and Database CSVs extract
13+
14+
====================
15+
19.6.17 - 2019-06-17
16+
====================
17+
Added
18+
-----
19+
* Support to extract to CSV using -csv, currently supported IAM Groups and Policies, Network, Load Balancers and Databases
20+
* Added subnet IP for the database node
21+
* Added Shape base OCPU, Memory and local storage to instances and databases
22+
* Added host+rules+path for load balancer listeners
23+
* Added Support for Exadata.Base.48
24+
25+
Fixed
26+
-----
27+
* Several Bugs
28+
* Fix Instances + db_node VNIC information
29+
* Fix All ports display at network security list
30+
731
====================
832
19.6.10 - 2019-06-10
933
====================

0 commit comments

Comments
 (0)