Skip to content

Commit

Permalink
Merge pull request #51 from oracle/release_2018-03-08
Browse files Browse the repository at this point in the history
Releasing version 2.4.18
  • Loading branch information
vish1 authored Mar 9, 2018
2 parents 815b576 + b13deb5 commit 5e95677
Show file tree
Hide file tree
Showing 26 changed files with 1,230 additions and 82 deletions.
39 changes: 33 additions & 6 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,55 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a
Changelog <http://keepachangelog.com/>`__.

2.4.18 - 2018-03-08
---------------------
Added
~~~~~~~~~~
* Support for the Email Service. (``oci email``)

* A sample test using the email feature can be found on `Github <https://github.com/oracle/oci-cli/blob/master/tests/test_email.py>`_

* Support for the following features in the Core Services:

* paravirtualized volume attachments (--type option for ``oci compute volume-attachment attach``)
* variable size boot volumes (--boot-volume-size-in-gbs option for ``oci compute instance launch``)

* Support for auto-pagination for the Domain Name System Service. (--all, --page-size options for ``oci dns record domain get``, ``oci dns record rrset get``, ``oci dns record zone get``)
* Support for no-overwrite flag for the object put operation for the Object Service (--no-overwrite for ``oci os object put``).

Fixed
~~~~~~~~~~
* Updated config / key file permissions logic on Windows to depend on well known SIDs instead of account / group name to
fix localization issues. This affects ``oci setup config``, ``oci setup repair-file-permissions``, and the general
config / key file permissions check performed by other commands.

2.4.17 - 2018-02-22
---------------------
Added
~~~~~~~~~~
* Added support for the File Storage Service. (``oci fs``)
* Added support for Path Route Sets in the Load Balancer Service. An example can be found on `Github <https://github.com/oracle/oci-cli/blob/master/scripts/create_load_balancer.sh>`_ (``oci lb path-route-set``)
* Added tagging support for *Bucket* resources in the Object Storage Service
* Support for the File Storage Service. (``oci fs``)
* Support for Path Route Sets in the Load Balancer Service. An example can be found on `Github <https://github.com/oracle/oci-cli/blob/master/scripts/create_load_balancer.sh>`_ (``oci lb path-route-set``)
* Tagging support for *Bucket* resources in the Object Storage Service

* Create a bucket with tags: ``oci os bucket create --defined-tags --freeform-tags``
* Update a bucket with tags: ``oci os bucket update --defined-tags --freeform-tags``
* List buckets and display defined and freeform tags in the results: ``oci os bucket list --fields tags``
* Added support for specifying a restore period for archived objects in the *RestoreObjects* operation of the Object Storage service. (``oci os object restore --hours``)
* Added support for filtering by *backupId* in *ListDbSystems* operation in the Database Service (``oci db system list --backup-id``)
* Added support for getting plink (the `PuTTY <https://www.putty.org/>`_ command line interface) compatible instance console connection string for Windows users (``oci compute instance-console-connection get-plink-connection-string``)

* Support for specifying a restore period for archived objects in the *RestoreObjects* operation of the Object Storage service. (``oci os object restore --hours``)
* Support for filtering by *backupId* in *ListDbSystems* operation in the Database Service (``oci db system list --backup-id``)
* Support for getting plink (the `PuTTY <https://www.putty.org/>`_ command line interface) compatible instance console connection string for Windows users (``oci compute instance-console-connection get-plink-connection-string``)

2.4.16 - 2018-02-08
---------------------
Added
~~~~~~~~~~
* Support for Domain Name System Service (oci dns)

* An example on using the Domain Name System Service can be found on `GitHub <https://github.com/oracle/oci-cli/blob/master/scripts/dns_example.sh>`_.

* Support for Reserved Public IPs in Virtual Networking Service (oci network public-ip)
* Support for the following features in Block Storage Service

* Automated and policy-based scheduled backups (oci bv volume-backup-policy | volume-backup-policy-assignment)
* Read-only volume attachments (--is-read-only option while attaching volume)
* Incremental backups (--type option while creating a volume backup)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Jinja2==2.9.6
jmespath==0.9.3
ndg-httpsclient==0.4.2
mock==2.0.0
oci==1.3.15
oci==1.3.16
packaging==16.8
pluggy==0.4.0
py==1.4.33
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def open_relative(*path):


requires = [
'oci==1.3.15',
'oci==1.3.16',
'arrow==0.10.0',
'certifi',
'click==6.7',
Expand Down
2 changes: 2 additions & 0 deletions src/oci_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .generated import compute_cli # noqa: F401
from .generated import database_cli # noqa: F401
from .generated import dns_cli # noqa: F401
from .generated import email_cli # noqa: F401
from .generated import filestorage_cli # noqa: F401
from .generated import identity_cli # noqa: F401
from .generated import loadbalancer_cli # noqa: F401
Expand All @@ -24,6 +25,7 @@
from . import dns_cli_extended # noqa: F401
from . import identity_cli_extended # noqa: F401
from . import objectstorage_cli_extended # noqa: F401
from . import email_cli_extended # noqa: F401
from . import filestorage_cli_extended # noqa: F401
from . import file_filters # noqa: F401
from . import final_command_processor # noqa: F401
Expand Down
31 changes: 25 additions & 6 deletions src/oci_cli/bin/OciTabExpansion.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.

$ociTopLevelCommands = @(
'audit', 'bv', 'compute', 'db', 'dns', 'fs', 'iam', 'lb', 'network', 'os', 'setup'
'audit', 'bv', 'compute', 'db', 'dns', 'email', 'fs', 'iam', 'lb', 'network', 'os', 'setup'
)

$ociSubcommands = @{
Expand Down Expand Up @@ -46,6 +46,9 @@ $ociSubcommands = @{
'dns record rrset' = 'delete get patch update'
'dns record zone' = 'get patch update'
'dns zone' = 'create delete get list update'
'email' = 'sender suppression'
'email sender' = 'create delete get list'
'email suppression' = 'create delete get list'
'fs' = 'export export-set file-system mount-target snapshot'
'fs export' = 'create delete get list'
'fs export-set' = 'get list update'
Expand Down Expand Up @@ -155,7 +158,7 @@ $ociCommandsToLongParams = @{
'compute instance detach-vnic' = 'compartment-id force from-json help max-wait-seconds vnic-id wait-for-state wait-interval-seconds'
'compute instance get' = 'from-json help instance-id'
'compute instance get-windows-initial-creds' = 'from-json help instance-id'
'compute instance launch' = 'assign-public-ip availability-domain compartment-id defined-tags display-name extended-metadata freeform-tags from-json help hostname-label image-id ipxe-script-file max-wait-seconds metadata private-ip shape skip-source-dest-check source-boot-volume-id source-details ssh-authorized-keys-file subnet-id user-data-file vnic-display-name wait-for-state wait-interval-seconds'
'compute instance launch' = 'assign-public-ip availability-domain boot-volume-size-in-gbs compartment-id defined-tags display-name extended-metadata freeform-tags from-json help hostname-label image-id ipxe-script-file max-wait-seconds metadata private-ip shape skip-source-dest-check source-boot-volume-id source-details ssh-authorized-keys-file subnet-id user-data-file vnic-display-name wait-for-state wait-interval-seconds'
'compute instance list' = 'all availability-domain compartment-id display-name from-json help lifecycle-state limit page page-size sort-by sort-order'
'compute instance list-vnics' = 'all from-json help instance-id limit page page-size'
'compute instance terminate' = 'force from-json help if-match instance-id max-wait-seconds preserve-boot-volume wait-for-state wait-interval-seconds'
Expand Down Expand Up @@ -213,21 +216,29 @@ $ociCommandsToLongParams = @{
'db system-shape list' = 'all availability-domain compartment-id from-json help limit page page-size'
'db version list' = 'all compartment-id db-system-shape from-json help limit page page-size'
'dns record domain delete' = 'compartment-id domain force from-json help if-match if-unmodified-since zone-name-or-id'
'dns record domain get' = 'compartment-id domain from-json help if-modified-since if-none-match limit page rtype sort-by sort-order zone-name-or-id zone-version'
'dns record domain get' = 'all compartment-id domain from-json help if-modified-since if-none-match limit page page-size rtype sort-by sort-order zone-name-or-id zone-version'
'dns record domain patch' = 'compartment-id domain from-json help if-match if-unmodified-since items zone-name-or-id'
'dns record domain update' = 'compartment-id domain force from-json help if-match if-unmodified-since items zone-name-or-id'
'dns record rrset delete' = 'compartment-id domain force from-json help if-match if-unmodified-since rtype zone-name-or-id'
'dns record rrset get' = 'compartment-id domain from-json help if-modified-since if-none-match limit page rtype zone-name-or-id zone-version'
'dns record rrset get' = 'all compartment-id domain from-json help if-modified-since if-none-match limit page page-size rtype zone-name-or-id zone-version'
'dns record rrset patch' = 'compartment-id domain from-json help if-match if-unmodified-since items rtype zone-name-or-id'
'dns record rrset update' = 'compartment-id domain force from-json help if-match if-unmodified-since items rtype zone-name-or-id'
'dns record zone get' = 'compartment-id domain domain-contains from-json help if-modified-since if-none-match limit page rtype sort-by sort-order zone-name-or-id zone-version'
'dns record zone get' = 'all compartment-id domain domain-contains from-json help if-modified-since if-none-match limit page page-size rtype sort-by sort-order zone-name-or-id zone-version'
'dns record zone patch' = 'compartment-id from-json help if-match if-unmodified-since items zone-name-or-id'
'dns record zone update' = 'compartment-id force from-json help if-match if-unmodified-since items zone-name-or-id'
'dns zone create' = 'compartment-id external-masters from-json help max-wait-seconds name wait-for-state wait-interval-seconds zone-type'
'dns zone delete' = 'compartment-id force from-json help if-match if-unmodified-since max-wait-seconds wait-for-state wait-interval-seconds zone-name-or-id'
'dns zone get' = 'compartment-id from-json help if-modified-since if-none-match zone-name-or-id'
'dns zone list' = 'all compartment-id from-json help lifecycle-state limit name name-contains page page-size sort-by sort-order time-created-greater-than-or-equal-to time-created-less-than zone-type'
'dns zone update' = 'compartment-id external-masters force from-json help if-match if-unmodified-since max-wait-seconds wait-for-state wait-interval-seconds zone-name-or-id'
'email sender create' = 'compartment-id email-address from-json help max-wait-seconds wait-for-state wait-interval-seconds'
'email sender delete' = 'force from-json help max-wait-seconds sender-id wait-for-state wait-interval-seconds'
'email sender get' = 'from-json help sender-id'
'email sender list' = 'all compartment-id email-address from-json help lifecycle-state limit page page-size sort-by sort-order'
'email suppression create' = 'compartment-id email-address from-json help'
'email suppression delete' = 'force from-json help suppression-id'
'email suppression get' = 'from-json help suppression-id'
'email suppression list' = 'all compartment-id email-address from-json help limit page page-size sort-by sort-order time-created-greater-than-or-equal-to time-created-less-than'
'fs export create' = 'export-set-id file-system-id from-json help max-wait-seconds path wait-for-state wait-interval-seconds'
'fs export delete' = 'export-id force from-json help if-match max-wait-seconds wait-for-state wait-interval-seconds'
'fs export get' = 'export-id from-json help'
Expand Down Expand Up @@ -430,7 +441,7 @@ $ociCommandsToLongParams = @{
'os object get' = 'bucket-name file from-json help if-match if-none-match multipart-download-threshold name namespace parallel-download-count part-size range'
'os object head' = 'bucket-name from-json help if-match if-none-match name namespace'
'os object list' = 'all bucket-name delimiter end fields from-json help limit namespace page-size prefix start'
'os object put' = 'bucket-name content-encoding content-language content-md5 content-type disable-parallel-uploads file force from-json help if-match metadata name namespace no-multipart parallel-upload-count part-size'
'os object put' = 'bucket-name content-encoding content-language content-md5 content-type disable-parallel-uploads file force from-json help if-match metadata name namespace no-multipart no-overwrite parallel-upload-count part-size'
'os object rename' = 'bucket bucket-name from-json help name namespace namespace-name new-if-match new-if-none-match new-name new-obj-if-match-e-tag new-obj-if-none-match-e-tag source-name src-if-match src-obj-if-match-e-tag'
'os object restore' = 'bucket from-json help hours name namespace'
'os object restore-status' = 'bucket-name from-json help name namespace'
Expand Down Expand Up @@ -568,6 +579,14 @@ $ociCommandsToShortParams = @{
'dns zone get' = '? c h'
'dns zone list' = '? c h'
'dns zone update' = '? c h'
'email sender create' = '? c h'
'email sender delete' = '? h'
'email sender get' = '? h'
'email sender list' = '? c h'
'email suppression create' = '? c h'
'email suppression delete' = '? h'
'email suppression get' = '? h'
'email suppression list' = '? c h'
'fs export create' = '? h'
'fs export delete' = '? h'
'fs export get' = '? h'
Expand Down
2 changes: 2 additions & 0 deletions src/oci_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .generated import compute_cli # noqa: F401
from .generated import database_cli # noqa: F401
from .generated import dns_cli # noqa: F401
from .generated import email_cli # noqa: F401
from .generated import filestorage_cli # noqa: F401
from .generated import identity_cli # noqa: F401
from .generated import loadbalancer_cli # noqa: F401
Expand All @@ -19,6 +20,7 @@
from . import core_cli_extended # noqa: F401
from . import database_cli_extended # noqa: F401
from . import dns_cli_extended # noqa: F401
from . import email_cli_extended # noqa: F401
from . import filestorage_cli_extended # noqa: F401
from . import identity_cli_extended # noqa: F401
from . import lb_cli_extended # noqa: F401
Expand Down
3 changes: 3 additions & 0 deletions src/oci_cli/cli_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from oci.core import VirtualNetworkClient
from oci.database import DatabaseClient
from oci.dns import DnsClient
from oci.email import EmailClient
from oci.file_storage import FileStorageClient
from oci.identity import IdentityClient
from oci.load_balancer import LoadBalancerClient
Expand All @@ -19,6 +20,7 @@
"compute": ComputeClient,
"database": DatabaseClient,
"dns": DnsClient,
"email": EmailClient,
"file_storage": FileStorageClient,
"identity": IdentityClient,
"load_balancer": LoadBalancerClient,
Expand All @@ -31,6 +33,7 @@
"core": oci.core.models.core_type_mapping,
"database": oci.database.models.database_type_mapping,
"dns": oci.dns.models.dns_type_mapping,
"email": oci.email.models.email_type_mapping,
"file_storage": oci.file_storage.models.file_storage_type_mapping,
"identity": oci.identity.models.identity_type_mapping,
"load_balancer": oci.load_balancer.models.load_balancer_type_mapping,
Expand Down
7 changes: 4 additions & 3 deletions src/oci_cli/cli_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,17 +447,18 @@ def apply_user_only_access_permissions(path):
# - thus if the user elects to place a new file (config or key) in an existing directory, we will not change the
# permissions of that directory but will explicitly set the permissions on that file
username = os.environ['USERNAME']
admin_grp = '*S-1-5-32-544'
system_usr = '*S-1-5-18'
try:
if os.path.isfile(path):
subprocess.check_output('icacls "{path}" /reset'.format(path=path), stderr=subprocess.STDOUT)
subprocess.check_output('icacls "{path}" /inheritance:r /grant:r {username}:F /grant Administrators:F /grant System:F'.format(path=path, username=username), stderr=subprocess.STDOUT)
subprocess.check_output('icacls "{path}" /inheritance:r /grant:r {username}:F /grant {admin_grp}:F /grant {system_usr}:F'.format(path=path, username=username, admin_grp=admin_grp, system_usr=system_usr), stderr=subprocess.STDOUT)
else:
if os.listdir(path):
# safety check to make sure we aren't changing permissions of existing files
raise RuntimeError("Failed attempting to set permissions on existing folder that is not empty.")

subprocess.check_output('icacls "{path}" /reset'.format(path=path), stderr=subprocess.STDOUT)
subprocess.check_output('icacls "{path}" /inheritance:r /grant:r {username}:(OI)(CI)F /grant:r Administrators:(OI)(CI)F /grant:r System:(OI)(CI)F'.format(path=path, username=username), stderr=subprocess.STDOUT)
subprocess.check_output('icacls "{path}" /inheritance:r /grant:r {username}:(OI)(CI)F /grant:r {admin_grp}:(OI)(CI)F /grant:r {system_usr}:(OI)(CI)F'.format(path=path, username=username, admin_grp=admin_grp, system_usr=system_usr), stderr=subprocess.STDOUT)

except subprocess.CalledProcessError as exc_info:
print("Error occurred while attempting to set permissions for {path}: {exception}".format(path=path, exception=str(exc_info)))
Expand Down
Loading

0 comments on commit 5e95677

Please sign in to comment.