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
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.idea
*.iml
*.egg-info
.tox/
.python-version
*.pyc
*.swp
build/
dist/
env/
*.egg-info/
*.zip
.DS_STORE
data/
docs/warnings.txt
docs/process_sources_warnings.txt
docs/_build/
src/oci_cli/help_text_producer/data_files/man
src/oci_cli/help_text_producer/data_files/text
scripts/temp/
target/
tests/resources/content_output.txt
tests/output/console_history_output.txt
tests/temp
.cache/
.project
.wercker/
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ 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.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
* 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``)

2.4.16 - 2018-02-08
---------------------
Added
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Contributing to the Oracle Cloud Infrastructure CLI
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.*
*Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.*

Pull requests can be made under
`The Oracle Contributor Agreement <https://www.oracle.com/technetwork/community/oca-486395.html>`_ (OCA).
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.14
oci==1.3.15
packaging==16.8
pluggy==0.4.0
py==1.4.33
Expand Down
33 changes: 25 additions & 8 deletions scripts/create_load_balancer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# - Creating a load balancer by providing all options at create time (e.g. certificates, listeners, backend sets)
# - We also show two sub-variants: providing each option as an individual parameter (e.g. --certificiates, --listeners) and how to provide a consolidated
# set of options using --from-json
# set of options using --from-json
# - Creating a load balancer by providing the minimum options at create time and then adding related resources (e.g. certificates, listeners, backend sets)
# post-creation
#
Expand Down Expand Up @@ -43,14 +43,18 @@ echo "Load Balancer Shape: $LB_SHAPE"
# This also provides each complex type as an individual option (e.g. --certificates, --listeners). It is also possible to provide these in a consolidated format, which is demonstrated
# by the function create_lb_with_all_options_using_from_json
function create_lb_with_all_options_as_individual_options() {
# certificates_with_comments.json contains a description of the parameter. Since valid JSON cannot contain comments, we use jsonlint (which was installed
# certificates_with_comments.json contains a description of the parameter. Since valid JSON cannot contain comments, we use jsonlint (which was installed
# via our demjson dependency) to remove the comments and allow the CLI to use it.
#
# You should replace the values in certificates_with_comments.json with those appropriate for your use case (e.g. your own PEM-formatted strings)
jsonlint -Sf scripts/create_load_balancer_example/certificates_with_comments.json > scripts/create_load_balancer_example/certificates.json

jsonlint -Sf scripts/create_load_balancer_example/backend_sets_with_comments.json > scripts/create_load_balancer_example/backend_sets.json
jsonlint -Sf scripts/create_load_balancer_example/listeners_with_comments.json > scripts/create_load_balancer_example/listeners.json
# Path Route Sets are not mandatory parameter to load balancer. They enhance
# load balancer feature set by providing traffic routing flexibility.
# More info about the feature can be found in scripts/create_load_balancer_example/path_route_sets_with_comments.json
jsonlint -Sf scripts/create_load_balancer_example/path_route_sets_with_comments.json > scripts/create_load_balancer_example/path_route_sets.json

# Subnets are passed as a JSON array where each entry is a subnet OCID. For example:
#
Expand All @@ -60,14 +64,14 @@ function create_lb_with_all_options_as_individual_options() {
echo "[\"${FIRST_SUBNET_ID}\", \"${SECOND_SUBNET_ID}\"]" > scripts/create_load_balancer_example/subnets.json

# Note here in our create we use --certificates, --listeners etc. to pass in each complex type
#
#
# There is some implicit sequencing in that:
# - The backend set information (--backend-sets) may need the name of the certificate bundle specified in --certificates
# - The listener information (--listeners) needs the name of one of the backend sets in --backend-sets
# - The listener information (--listeners) may need the name of the certificate bundle specified in --certificates
#
# So you need to take that into account when preparing your files for input
CREATED_LB=$(oci lb load-balancer create -c $COMPARTMENT_ID --display-name exampleLb --shape-name $LB_SHAPE --subnet-ids file://scripts/create_load_balancer_example/subnets.json --certificates file://scripts/create_load_balancer_example/certificates.json --backend-sets file://scripts/create_load_balancer_example/backend_sets.json --listeners file://scripts/create_load_balancer_example/listeners.json)
CREATED_LB=$(oci lb load-balancer create -c $COMPARTMENT_ID --display-name exampleLb --shape-name $LB_SHAPE --subnet-ids file://scripts/create_load_balancer_example/subnets.json --certificates file://scripts/create_load_balancer_example/certificates.json --backend-sets file://scripts/create_load_balancer_example/backend_sets.json --listeners file://scripts/create_load_balancer_example/listeners.json --path-route-sets file://scripts/create_load_balancer_example/path_route_sets.json)
WORK_REQUEST_ID=$(jq -r '."opc-work-request-id"' <<< "$CREATED_LB")
echo "Create Load Balancer Work Request ID: $WORK_REQUEST_ID"

Expand Down Expand Up @@ -96,7 +100,7 @@ function create_lb_with_all_options_as_individual_options() {
sleep 120
}

# We've seen in the create_lb_with_all_options_as_individual_options function that we can create a load balancer and provide complex parameters, such as --backend-sets,
# We've seen in the create_lb_with_all_options_as_individual_options function that we can create a load balancer and provide complex parameters, such as --backend-sets,
# as separate options. However, rather than specifying complex parameters individually, we can supply them in a consolidated format - in this case by passing it in
# as a single file to the --from-json option.
#
Expand Down Expand Up @@ -189,7 +193,19 @@ function create_lb_with_minimum_then_add_related_resources() {
oci lb backend create --load-balancer-id $LB_ID --backend-set-name backendSetName --ip-address 10.10.10.4 --port 80 --weight 3
oci lb backend create --load-balancer-id $LB_ID --backend-set-name backendSetName --ip-address 10.10.10.5 --port 80 --weight 3

# Now that we have our certificates and backend set, we can add a listener. We need to specify a backend set which exists (e.g. the one we made)
# We can create Path Route Sets now since we have our backend set created.
# Path Route Sets require backend sets to be mentioned as part of path route
# rules. A path route set includes all path route strings and matching rules
# that define the data routing for a particular listener. Path Route rules
# enable routing of traffic to correct backend set eliminating the need to
# create multiple listeners or load balancers to achieve the same.
oci lb path-route-set create --load-balancer-id $LB_ID \
--name PathRouteSetName \
--path-routes '[{"backendSetName":"backendSetName", "path":"/video", "pathMatchType":{"matchType":"EXACT_MATCH"}}]' \
--wait-for-state SUCCEEDED \
--max-wait-seconds 300

# Now that we have our certificates, backend set and path route set, we can add a listener. We need to specify a backend set which exists (e.g. the one we made)
#
# The valid values for --protocol can be found via "oci lb protocol list"
#
Expand All @@ -201,7 +217,8 @@ function create_lb_with_minimum_then_add_related_resources() {
--protocol HTTP \
--ssl-certificate-name my_cert_bundle \
--ssl-verify-depth 3 \
--ssl-verify-peer-certificate false
--ssl-verify-peer-certificate false \
--path-route-set-name PathRouteSetName

# Print out information about the load balancer
oci lb load-balancer get --load-balancer-id $LB_ID
Expand All @@ -220,4 +237,4 @@ oci network subnet delete --subnet-id $FIRST_SUBNET_ID --force --wait-for-state
oci network subnet delete --subnet-id $SECOND_SUBNET_ID --force --wait-for-state TERMINATED

# Delete the VCN
oci network vcn delete --vcn-id $VCN_ID --force --wait-for-state TERMINATED
oci network vcn delete --vcn-id $VCN_ID --force --wait-for-state TERMINATED
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@
"defaultBackendSetName": "backendSetName",
"port": 8080,
"protocol": "HTTP"
"pathRouteSetName": "PathRouteSetName"
}
},
"pathRouteSets": {
"PathRouteSetName": {
"pathRoutes": [
{
"backendSetName": "backendSetName",
"path": "/video",
"pathMatchType": {
"matchType": "EXACT_MATCH"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
/*
* Each entry in this dictionary represents a path route set which can be used
* by a load balancer. A path route set includes all path route strings and
* matching rules that define the data routing for a particular listener.
*/
"PathRouteSetName": {
/* A path route is a string that the Load Balancing service matches against
* an incoming URI to determine the appropriate destination backend set. A
* path route rule consists of a path route string and a pattern match type.
*/
/* For more information about each attribute and the feature, refer this link:
* https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Tasks/managingrequest.htm#path
*/
"pathRoutes": [
{
// The backend set to which the traffic should be routed
"backendSetName": "backendSetName",
// The path string to be used for matching with the incoming HTTP/HTTPS URI
// The unique part of the URI e.g. /video, /data, etc.
"path": "/video",
// Rule match type. Pick one option from below link:
// https://docs.us-phoenix-1.oraclecloud.com/api/#/en/loadbalancer/20170115/requests/PathMatchType
"pathMatchType": {
"matchType": "EXACT_MATCH"
}
}
]
}
// Uncomment the below (and change information as needed) to add another path
// route set when creating the load balancer. You could copy it as many times
// as necessary to add all the path route stes you need
/*
, "PathRouteSetName2": {
// A path route set can have more than one path routes. A maximum of 20 are allowed.
"pathRoutes": [
{
"backendSetName": "mySecondBackendSetName",
"path": "/cgi",
"pathMatchType": {
"matchType": "FORCE_LONGEST_PREFIX_MATCH"
}
},
{
"backendSetName": "myThirdBackendSetName",
"path": "/data",
"pathMatchType": {
"matchType": "SUFFIX_MATCH"
}
}
]
}
*/
}
Loading