Skip to content

Commit 9555623

Browse files
authored
Releasing version 2.21.0
Releasing version 2.21.0
2 parents 2e256c6 + b61d12f commit 9555623

File tree

105 files changed

+5091
-729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+5091
-729
lines changed

CHANGELOG.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ Change Log
33
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/>`_.
6+
====================
7+
2.21.0 - 2020-08-11
8+
====================
9+
10+
Added
11+
-----
12+
* Support for autonomous json databases in the Database service
13+
* Support for cleaning up uncommitted multipart uploads in the Object Storage service
14+
* Support for additional list API filters in the Data Catalog service
15+
16+
Breaking
17+
--------
18+
* Some unusable region enums were removed from the Support Management service
19+
* Parameter `opc_retry_token` was removed from the Support Management service
20+
621
====================
722
2.20.0 - 2020-08-04
823
====================
@@ -19,6 +34,10 @@ Breaking
1934
--------
2035
* Param `life_cycle_details` renamed to `lifecycle_details` in models `BlockchainPlatformByHostname` and `BlockchainPlatformSummary` in the Blockchain service
2136

37+
Changed
38+
-------
39+
* Restricted `pyOpenSSL` dependency to versions between 17.5.0 and 19.1.0, both inclusive. See `#255 <https://github.com/oracle/oci-python-sdk/issues/255>`_ for details.
40+
2241
====================
2342
2.19.0 - 2020-07-28
2443
====================

docs/api/cims.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ Cims
77
:template: autosummary/service_client.rst
88

99
oci.cims.IncidentClient
10+
oci.cims.UserClient
1011
oci.cims.IncidentClientCompositeOperations
12+
oci.cims.UserClientCompositeOperations
1113

1214
--------
1315
Models
@@ -23,6 +25,7 @@ Cims
2325
oci.cims.models.Classifier
2426
oci.cims.models.Contact
2527
oci.cims.models.ContactList
28+
oci.cims.models.ContextualData
2629
oci.cims.models.CreateCategoryDetails
2730
oci.cims.models.CreateIncident
2831
oci.cims.models.CreateIssueTypeDetails
@@ -32,6 +35,7 @@ Cims
3235
oci.cims.models.CreateSubCategoryDetails
3336
oci.cims.models.CreateTechSupportItemDetails
3437
oci.cims.models.CreateTicketDetails
38+
oci.cims.models.CreateUserDetails
3539
oci.cims.models.Incident
3640
oci.cims.models.IncidentResourceType
3741
oci.cims.models.IncidentSummary
@@ -51,4 +55,5 @@ Cims
5155
oci.cims.models.UpdateItemDetails
5256
oci.cims.models.UpdateResourceDetails
5357
oci.cims.models.UpdateTicketDetails
58+
oci.cims.models.User
5459
oci.cims.models.ValidationResponse
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
UserClient
2+
==========
3+
4+
.. currentmodule:: oci.cims
5+
6+
.. autoclass:: UserClient
7+
:special-members: __init__
8+
:members:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
UserClientCompositeOperations
2+
=============================
3+
4+
.. currentmodule:: oci.cims
5+
6+
.. autoclass:: UserClientCompositeOperations
7+
:special-members: __init__
8+
:members:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ContextualData
2+
==============
3+
4+
.. currentmodule:: oci.cims.models
5+
6+
.. autoclass:: ContextualData
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CreateUserDetails
2+
=================
3+
4+
.. currentmodule:: oci.cims.models
5+
6+
.. autoclass:: CreateUserDetails
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
User
2+
====
3+
4+
.. currentmodule:: oci.cims.models
5+
6+
.. autoclass:: User
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:

docs/api/landing.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ API Reference
1515
* :doc:`Blockchain Platform <blockchain/client/oci.blockchain.BlockchainPlatformClient>`
1616
* :doc:`Budget <budget/client/oci.budget.BudgetClient>`
1717
* :doc:`Incident <cims/client/oci.cims.IncidentClient>`
18+
* :doc:`User <cims/client/oci.cims.UserClient>`
1819
* :doc:`Container Engine <container_engine/client/oci.container_engine.ContainerEngineClient>`
1920
* :doc:`Block Storage <core/client/oci.core.BlockstorageClient>`
2021
* :doc:`Compute <core/client/oci.core.ComputeClient>`

examples/check_lb_cert_validity.py

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# coding: utf-8
2+
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
3+
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
4+
5+
# This script checks all load balancer certificates in the tenancy if they will remain valid
6+
# after N (user supplied) number of days. It traverses the compartment tree, locating
7+
# load balancer ctificates in each compartment. It extracts the "Not Valid After" attribute
8+
# and checks if the certificate will expire after N (user supplied) days.
9+
#
10+
# Usage:
11+
# python check_lb_cert_validity.py -d 'expiry-in-the-next-days' -c 'compartment-ocid'
12+
#
13+
# The script uses the default OCI SDK/CLI configuration file ~/.oci/config .
14+
15+
16+
import argparse
17+
import oci
18+
from cryptography import x509
19+
from cryptography.hazmat.backends import default_backend
20+
from datetime import datetime, timedelta
21+
22+
23+
def verify_cert_expiry(compartment_id, load_balancer_id, cert_bundle):
24+
25+
pem_cert = cert_bundle.public_certificate
26+
cert = x509.load_pem_x509_certificate(bytes(str(pem_cert), 'utf-8'), default_backend())
27+
cert_not_valid_after = cert.not_valid_after.date()
28+
29+
validity_date = datetime.utcnow().date().today() + timedelta(days=int(cert_validity_days))
30+
31+
if cert_not_valid_after <= validity_date:
32+
print("========================================================")
33+
print("Compartment Id: ", compartment_id)
34+
print("Load Balancer ID: ", load_balancer_id)
35+
print("Certificate Name: ", cert_bundle.certificate_name)
36+
print("Certificate Validity: ", cert.not_valid_after)
37+
print("Certificate expiring within {0} days.".format(cert_validity_days))
38+
print("========================================================\n")
39+
40+
41+
# Check certificates in a load balancer.
42+
def verify_certificates(compartment_id, load_balancer_id):
43+
44+
response = lb_client.list_certificates(load_balancer_id)
45+
46+
cert_list = response.data
47+
for i in cert_list:
48+
verify_cert_expiry(compartment_id, load_balancer_id, i)
49+
50+
51+
# Check certificates in all load balancers in a compartment.
52+
def inpect_lb_certs(compartment_id):
53+
54+
response = lb_client.list_load_balancers(compartment_id)
55+
lb_list = response.data
56+
57+
for i in lb_list:
58+
lb_id = i.id
59+
verify_certificates(compartment_id, lb_id)
60+
61+
62+
# Traverse the compartment tree and identify any expired certificates.
63+
def traverse_compartment_tree(compartment_id):
64+
65+
response = identity_client.list_compartments(compartment_id)
66+
child_compartment_list = response.data
67+
68+
length = len(child_compartment_list)
69+
70+
if length > 0:
71+
for i in child_compartment_list:
72+
child_compartment_id = i.id
73+
traverse_compartment_tree(child_compartment_id)
74+
75+
# Look for expiring certificates in load balancers belonging to this compartment.
76+
inpect_lb_certs(compartment_id)
77+
78+
79+
def main():
80+
81+
# Traverse the compartment heirarchy and identify the expiring certificates.
82+
traverse_compartment_tree(top_compartment)
83+
84+
85+
if __name__ == "__main__":
86+
parser = argparse.ArgumentParser()
87+
parser.add_argument("-d",
88+
"--expiry-in-the-next-days",
89+
action="store",
90+
help="check certificates which will expire in the coming days",
91+
required=True)
92+
parser.add_argument("-c",
93+
"--compartment-id",
94+
action="store",
95+
default="root",
96+
help="Compartment and its child compartments to be searched for expired load balancer certs ")
97+
98+
args = parser.parse_args()
99+
100+
# Get hold of the arguments.
101+
cert_validity_days = args.expiry_in_the_next_days
102+
top_compartment = args.compartment_id
103+
104+
try:
105+
config = oci.config.from_file()
106+
except oci.exceptions.ConfigFileNotFound as e:
107+
print("")
108+
print("ConfigFileNotFound: {}".format(e))
109+
print("")
110+
exit(-1)
111+
112+
# If compartment was not provided, default value is root.
113+
if "root" == top_compartment:
114+
top_compartment = config["tenancy"]
115+
116+
# Service clients
117+
identity_client = oci.identity.IdentityClient(config)
118+
lb_client = oci.load_balancer.LoadBalancerClient(config)
119+
120+
main()

0 commit comments

Comments
 (0)