Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ Change Log
All notable changes to this project will be documented in this file.

The format is based on `Keep a Changelog <http://keepachangelog.com/>`_.
====================
2.10.4 - 2020-02-11
====================

Added
-----
* Support for listing supported database versions for Autonomous Database Serverless, and selecting a version at provisioning time in the Database service
* Support for TCP proxy protocol versions on listener connection configurations in the Load Balancer service
* Support for calling the Notifications service in alternate realms
* Support for calling Oracle Cloud Infrastructure services in the eu-amsterdam-1 and me-jeddah-1 regions

====================
2.10.3 - 2020-02-04
====================
Expand Down
1 change: 1 addition & 0 deletions docs/api/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Database
oci.database.models.AutonomousDatabaseSummary
oci.database.models.AutonomousDatabaseWallet
oci.database.models.AutonomousDbPreviewVersionSummary
oci.database.models.AutonomousDbVersionSummary
oci.database.models.AutonomousExadataInfrastructure
oci.database.models.AutonomousExadataInfrastructureMaintenanceWindow
oci.database.models.AutonomousExadataInfrastructureShapeSummary
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
AutonomousDbVersionSummary
==========================

.. currentmodule:: oci.database.models

.. autoclass:: AutonomousDbVersionSummary
:show-inheritance:
:special-members: __init__
:members:
:undoc-members:
:inherited-members:
12 changes: 12 additions & 0 deletions examples/showoci/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.

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

=====================
20.02.11 - 2020-02-11
=====================
* Add support for Function Applications (-fun)
* Add support for API gateways (-api)
* Fix limits to use pagination to produce all rows

=====================
20.01.30 - 2020-01-30
=====================
* Add DRG Redundant status

=====================
20.01.29 - 2020-01-29
=====================
Expand Down
100 changes: 51 additions & 49 deletions examples/showoci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Output can be printer friendly, CSV files or JSON file.
- oci.analytics.AnalyticsClient
- oci.oda.OdaClient
- oci.oce.OceInstanceClient
- oci.apigateway.GatewaysClient
- oci.functions.FunctionsManagementClient

** DISCLAIMER – This is not an official Oracle application

Expand Down Expand Up @@ -176,57 +178,57 @@ Execute
```
$ ./showoci.py

usage: showoci.py [-h] [-a] [-ani] [-an] [-b] [-n] [-i] [-ic] [-c] [-cn] [-o]
[-l] [-d] [-f] [-e] [-m] [-s] [-rm] [-so] [-paas] [-edge]
[-lq] [-mc] [-nr] [-ip] [-t PROFILE] [-p PROXY] [-rg REGION]
[-cp COMPART] [-cpr COMPART_RECURSIVE] [-cpath COMPARTPATH]
[-tenantid TENANTID] [-cf CONFIG] [-csv CSV] [-jf JOUTFILE]
[-js] [-sjf SJOUTFILE] [-cachef SERVICEFILE] [-caches]
[--version]
usage: showoci.py [-h] [-a] [-ani] [-an] [-api] [-b] [-c] [-cn] [-d] [-e]
[-edge] [-f] [-fun] [-i] [-ic] [-l] [-lq] [-m] [-n] [-o]
[-paas] [-rm] [-s] [-so] [-mc] [-nr] [-ip] [-t PROFILE]
[-p PROXY] [-rg REGION] [-cp COMPART] [-cpr COMPART_RECUR]
[-cpath COMPARTPATH] [-tenantid TENANTID] [-cf CONFIG]
[-csv CSV] [-jf JOUTFILE] [-js] [-sjf SJOUTFILE]
[-cachef SERVICEFILE] [-caches] [--version]

optional arguments:
-h, --help show this help message and exit
-a Print All Resources
-ani Print All Resources but identity
-an Print Announcements
-b Print Budgets
-n Print Network
-i Print Identity
-ic Print Identity Compartments only
-c Print Compute
-cn Print Containers
-o Print Object Storage
-l Print Load Balancer
-d Print Database
-f Print File Storage
-e Print EMail
-m Print Monitoring and Notifications
-s Print Streams
-rm Print Resource management
-so Print Summary Only
-paas Print Oracle Paas Native - OIC OAC ODA
-edge Print Edge Services (Healthcheck)
-lq Print Limits and Quotas
-mc exclude ManagedCompartmentForPaaS
-nr Not include root compartment
-ip Use Instance Principals for Authentication
-t PROFILE Config file section to use (tenancy profile)
-p PROXY Set Proxy (i.e. www-proxy-server.com:80)
-rg REGION Filter by Region
-cp COMPART Filter by Compartment Name or OCID
-cpr COMPART_RECURSIVE
Filter by Compartment Name or OCID include sub
compartments
-cpath COMPARTPATH Filter by Compartment path ,(i.e. -cpath "Adi / Sub"
-tenantid TENANTID Override confile file tenancy_id
-cf CONFIG Config File
-csv CSV Output to CSV files, Input as file header
-jf JOUTFILE Output to file (JSON format)
-js Output to screen (JSON format)
-sjf SJOUTFILE Output to screen (nice format) and JSON File
-cachef SERVICEFILE Output Cache to file (JSON format)
-caches Output Cache to screen (JSON format)
--version show program's version number and exit
-h, --help show this help message and exit
-a Print All Resources
-ani Print All Resources but identity
-an Print Announcements
-api Print API Gateways
-b Print Budgets
-c Print Compute
-cn Print Containers
-d Print Database
-e Print EMail
-edge Print Edge Services (Healthcheck)
-f Print File Storage
-fun Print Functions
-i Print Identity
-ic Print Identity Compartments only
-l Print Load Balancer
-lq Print Limits and Quotas
-m Print Monitoring and Notifications
-n Print Network
-o Print Object Storage
-paas Print Oracle Paas Native - OIC OAC ODA
-rm Print Resource management
-s Print Streams
-so Print Summary Only
-mc exclude ManagedCompartmentForPaaS
-nr Not include root compartment
-ip Use Instance Principals for Authentication
-t PROFILE Config file section to use (tenancy profile)
-p PROXY Set Proxy (i.e. www-proxy-server.com:80)
-rg REGION Filter by Region
-cp COMPART Filter by Compartment Name or OCID
-cpr COMPART_RECUR Filter by Comp Name or OCID Recursive
-cpath COMPARTPATH Filter by Compartment path ,(i.e. -cpath "Adi / Sub"
-tenantid TENANTID Override confile file tenancy_id
-cf CONFIG Config File
-csv CSV Output to CSV files, Input as file header
-jf JOUTFILE Output to file (JSON format)
-js Output to screen (JSON format)
-sjf SJOUTFILE Output to screen (nice format) and JSON File
-cachef SERVICEFILE Output Cache to file (JSON format)
-caches Output Cache to screen (JSON format)
--version show program's version number and exit

```

Expand Down
50 changes: 35 additions & 15 deletions examples/showoci/showoci.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,20 @@
# - oci.healthchecks.HealthChecksClient
# - oci.announcements_service.AnnouncementClient
# - oci.limits.LimitsClient
# - oci.integration.IntegrationInstanceClient
# - oci.analytics.AnalyticsClient
# - oci.oda.OdaClient
# - oci.oce.OceInstanceClient
# - oci.apigateway.GatewaysClient
# - oci.functions.FunctionsManagementClient
#
# Modules Not Yet Covered:
# - oci.waas.WaasClient
# - oci.dns.DnsClient
# - oci.data_catalog.DataCatalogClient
# - oci.data_flow.DataFlowClient
# - oci.data_science.DataScienceClient
# - oci.events.EventsClient
#
##########################################################################
from __future__ import print_function
Expand All @@ -62,7 +72,7 @@
import argparse
import datetime

version = "20.1.29"
version = "20.2.11"

##########################################################################
# execute_extract
Expand Down Expand Up @@ -219,32 +229,35 @@ def set_parser_arguments():
parser.add_argument('-a', action='store_true', default=False, dest='all', help='Print All Resources')
parser.add_argument('-ani', action='store_true', default=False, dest='allnoiam', help='Print All Resources but identity')
parser.add_argument('-an', action='store_true', default=False, dest='announcement', help='Print Announcements')
parser.add_argument('-api', action='store_true', default=False, dest='api', help='Print API Gateways')
parser.add_argument('-b', action='store_true', default=False, dest='budgets', help='Print Budgets')
parser.add_argument('-n', action='store_true', default=False, dest='network', help='Print Network')
parser.add_argument('-i', action='store_true', default=False, dest='identity', help='Print Identity')
parser.add_argument('-ic', action='store_true', default=False, dest='identity_compartments', help='Print Identity Compartments only')
parser.add_argument('-c', action='store_true', default=False, dest='compute', help='Print Compute')
parser.add_argument('-cn', action='store_true', default=False, dest='container', help='Print Containers')
parser.add_argument('-o', action='store_true', default=False, dest='object', help='Print Object Storage')
parser.add_argument('-l', action='store_true', default=False, dest='load', help='Print Load Balancer')
parser.add_argument('-d', action='store_true', default=False, dest='database', help='Print Database')
parser.add_argument('-f', action='store_true', default=False, dest='file', help='Print File Storage')
parser.add_argument('-e', action='store_true', default=False, dest='email', help='Print EMail')
parser.add_argument('-edge', action='store_true', default=False, dest='edge', help='Print Edge Services (Healthcheck)')
parser.add_argument('-f', action='store_true', default=False, dest='file', help='Print File Storage')
parser.add_argument('-fun', action='store_true', default=False, dest='function', help='Print Functions')
parser.add_argument('-i', action='store_true', default=False, dest='identity', help='Print Identity')
parser.add_argument('-ic', action='store_true', default=False, dest='identity_compartments', help='Print Identity Compartments only')
parser.add_argument('-l', action='store_true', default=False, dest='load', help='Print Load Balancer')
parser.add_argument('-lq', action='store_true', default=False, dest='limits', help='Print Limits and Quotas')
parser.add_argument('-m', action='store_true', default=False, dest='monitoring', help='Print Monitoring and Notifications')
parser.add_argument('-s', action='store_true', default=False, dest='streams', help='Print Streams')
parser.add_argument('-n', action='store_true', default=False, dest='network', help='Print Network')
parser.add_argument('-o', action='store_true', default=False, dest='object', help='Print Object Storage')
parser.add_argument('-paas', action='store_true', default=False, dest='paas_native', help='Print Oracle Paas Native - OIC OAC ODA')
parser.add_argument('-rm', action='store_true', default=False, dest='orm', help='Print Resource management')
parser.add_argument('-s', action='store_true', default=False, dest='streams', help='Print Streams')

parser.add_argument('-so', action='store_true', default=False, dest='sumonly', help='Print Summary Only')
parser.add_argument('-paas', action='store_true', default=False, dest='paas_native', help='Print Oracle Paas Native - OIC OAC ODA')
parser.add_argument('-edge', action='store_true', default=False, dest='edge', help='Print Edge Services (Healthcheck)')
parser.add_argument('-lq', action='store_true', default=False, dest='limits', help='Print Limits and Quotas')
parser.add_argument('-mc', action='store_true', default=False, dest='mgdcompart', help='exclude ManagedCompartmentForPaaS')
parser.add_argument('-nr', action='store_true', default=False, dest='noroot', help='Not include root compartment')
parser.add_argument('-ip', action='store_true', default=False, dest='instance_principals', help='Use Instance Principals for Authentication')
parser.add_argument('-t', default="", dest='profile', help='Config file section to use (tenancy profile)')
parser.add_argument('-p', default="", dest='proxy', help='Set Proxy (i.e. www-proxy-server.com:80) ')
parser.add_argument('-rg', default="", dest='region', help='Filter by Region')
parser.add_argument('-cp', default="", dest='compart', help='Filter by Compartment Name or OCID')
parser.add_argument('-cpr', default="", dest='compart_recursive', help='Filter by Compartment Name or OCID include sub compartments')
parser.add_argument('-cpr', default="", dest='compart_recur', help='Filter by Comp Name or OCID Recursive')
parser.add_argument('-cpath', default="", dest='compartpath', help='Filter by Compartment path ,(i.e. -cpath "Adi / Sub"')
parser.add_argument('-tenantid', default="", dest='tenantid', help='Override confile file tenancy_id')
parser.add_argument('-cf', type=argparse.FileType('r'), dest='config', help="Config File")
Expand All @@ -265,7 +278,8 @@ def set_parser_arguments():
if not (result.all or result.allnoiam or result.network or result.identity or result.identity_compartments or
result.compute or result.object or
result.load or result.database or result.file or result.email or result.orm or result.container or
result.streams or result.budgets or result.monitoring or result.edge or result.announcement or result.limits or result.paas_native):
result.streams or result.budgets or result.monitoring or result.edge or result.announcement or result.limits or result.paas_native or
result.api or result.function):

parser.print_help()

Expand Down Expand Up @@ -328,6 +342,12 @@ def set_service_extract_flags(cmd):
if cmd.all or cmd.allnoiam or cmd.budgets:
prm.read_budgets = True

if cmd.all or cmd.allnoiam or cmd.function:
prm.read_function = True

if cmd.all or cmd.allnoiam or cmd.api:
prm.read_api = True

if cmd.all or cmd.allnoiam or cmd.limits:
prm.read_limits = True

Expand Down Expand Up @@ -359,8 +379,8 @@ def set_service_extract_flags(cmd):
if cmd.compart:
prm.filter_by_compartment = str(cmd.compart)

if cmd.compart_recursive:
prm.filter_by_compartment_recursive = str(cmd.compart_recursive)
if cmd.compart_recur:
prm.filter_by_compartment_recursive = str(cmd.compart_recur)

if cmd.compartpath:
prm.filter_by_compartment_path = str(cmd.compartpath)
Expand Down
72 changes: 71 additions & 1 deletion examples/showoci/showoci_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,20 @@ def __get_oci_region_data(self, region_name):
data['paas_services'] = value
has_data = True

if self.service.flags.read_function:
value = self.__get_functions_main(region_name, compartment)
if value is not None:
if len(value) > 0:
data['functions'] = value
has_data = True

if self.service.flags.read_api:
value = self.__get_apigateway_main(region_name, compartment)
if value is not None:
if len(value) > 0:
data['apigateways'] = value
has_data = True

# add the data to main Variable
if has_data:
ret_var.append(data)
Expand Down Expand Up @@ -831,7 +845,7 @@ def __get_core_network_drg_name(self, drg_id):
# get DRG name
drg = self.service.search_unique_item(self.service.C_NETWORK, self.service.C_NETWORK_DRG, 'id', drg_id)
if drg:
return "DRG - " + drg['name']
return "DRG - " + drg['name'] + " (" + drg['redundancy'] + ")"
return ""

except Exception as e:
Expand Down Expand Up @@ -2362,6 +2376,62 @@ def __get_streams_main(self, region_name, compartment):
self.__print_error("__get_streams_main", e)
pass

##########################################################################
# functions
##########################################################################
def __get_functions_main(self, region_name, compartment):
try:
functions = self.service.search_multi_items(self.service.C_FUNCTION, self.service.C_FUNCTION_APPLICATIONS, 'region_name', region_name, 'compartment_id', compartment['id'])

data = []
if functions:
for fn in functions:
val = {'id': fn['id'],
'display_name': fn['display_name'],
'subnets': [],
'subnet_ids': fn['subnet_ids'],
'time_created': fn['time_created'],
'defined_tags': fn['defined_tags'],
'freeform_tags': fn['freeform_tags'],
'compartment_name': fn['compartment_name'],
'compartment_id': fn['compartment_id'],
'region_name': fn['region_name']
}

# subnets
for sub in fn['subnet_ids']:
val['subnets'].append(self.__get_core_network_subnet_name(sub))

data.append(val)
return data

except Exception as e:
self.__print_error("__get_functions_main", e)
pass

##########################################################################
# __get_apigateway_main
##########################################################################
def __get_apigateway_main(self, region_name, compartment):
try:
apigs = self.service.search_multi_items(self.service.C_API, self.service.C_API_GATEWAYS, 'region_name', region_name, 'compartment_id', compartment['id'])

data = []
if apigs:
for ap in apigs:
val = ap

# subnet
if ap['subnet_id']:
val['subnet_name'] = self.__get_core_network_subnet_name(ap['subnet_id'])

data.append(val)
return data

except Exception as e:
self.__print_error("__get_apigateway_main", e)
pass

##########################################################################
# monitoring
##########################################################################
Expand Down
Loading