Skip to content

Commit

Permalink
Releasing version 2.4.44
Browse files Browse the repository at this point in the history
Releasing version 2.4.44
  • Loading branch information
dshelbyo authored Feb 7, 2019
2 parents bb97ed2 + 1dc3e37 commit edb6b69
Show file tree
Hide file tree
Showing 44 changed files with 11,372 additions and 240 deletions.
44 changes: 44 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,50 @@ 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.44 - 2019-02-07
-------------------
Added
~~~~~
* Connection Strings for Database Resource API in Database Service

* The following commands responses have a new attribute `connectionStrings` added to them.
* (``oci db database get``)
* (``oci db database list``)

* Support for OCI DNS Traffic Management

* (``oci dns steering-policy``)
* (``oci dns steering-policy-attachment``)

* Support for Health Check Service (``oci health-checks``)

* Ability to create and manage http health check
* Ability to create and manage ping health check
* Ability to list available vantage points
* Ability to create on demand http probe

* Support for tagging Approved Senders in the Email Service.

* (``oci email sender create --defined-tags --freeform-tags``)
* (``oci email sender update --defined-tags --freeform-tags``)

* Support for Web Application Acceleration and Security Service (``oci waas``)

* An example on using the WAAS Service can be found on `GitHub <https://github.com/oracle/oci-cli/blob/master/scripts/examples/waas_example.sh>`__.

Changed
~~~~~~~
* Changed the behavior of kubernetes configuration download command (``oci ce cluster create-kubeconfig``) in Container Engine service as follows:

* Support for ``--overwrite`` flag while downloading kubernetes configuration. Using this flag ensures current behavior
of ``oci ce cluster create-kubeconfig`` command where an existing kubeconfig file is overwritten by downloaded content.
* Support for merging kubernetes configuration in Container Engine service. The command when used without ``--overwrite``
flag merges the downloaded kubeconfig with existing kubeconfig in the config file, if it exists.
* Support for writing kubernetes configuration to default location in Container Engine service. To support this, ``--file``
option in ``oci ce cluster create-kubeconfig`` command has been made optional. When not given, the default kubeconfig
location used is ``~/.kube/config``
* The details about this change are documented in (``oci ce cluster create-kubeconfig --help``)

2.4.43 - 2019-01-31
-------------------
Added
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Since the requirements.txt file doesn't support the --trusted-host option
# Since the requirements.txt file doesn't support the --trusted-host option
# (https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format),
# you may need to use the --extra-index-url option instead.

Expand All @@ -17,7 +17,7 @@ Jinja2==2.9.6
jmespath==0.9.3
ndg-httpsclient==0.4.2
mock==2.0.0
oci==2.1.6
oci==2.1.7
packaging==16.8
pluggy==0.4.0
py==1.4.33
Expand All @@ -39,3 +39,4 @@ tox==2.9.1
vcrpy==1.13.0
virtualenv==15.1.0
pytest-xdist==1.22.2
PyYAML==3.13
88 changes: 88 additions & 0 deletions scripts/examples/dns_traffic_management_example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/bash
# This script provides a basic example of how to use the Traffic Management
# feature of the DNS service in the CLI. The variables at the beginning of the
# script must be specified accordingly:
#
# * COMPARTMENT_ID: The first argument is the OCID of the compartment where we'll create a DNS zone
# * DNS_ZONE_NAME: The second is the name of the DNS zone to create (e.g. my-example-zone.com)
# * STEERING_POLICY_NAME: The third is the name of the Steering Policy (e.g. "Example Load Balance Policy")
# * DOMAIN_NAME: The fourth is the domain name within the zone to attach the policy to. The domain must be within the zone. (e.g. www.my-example-zone.com)
#
# Requirements for running this script:
# - OCI CLI v2.4.40 or later (you can check this by running oci --version)
# - jsonlint (required for converting commented JSON files to uncommented)

set -e

COMPARTMENT_ID=""
DNS_ZONE_NAME=""
STEERING_POLICY_NAME=""
DOMAIN_NAME=""

BORDER="=========================================="

function print_header() {
echo $BORDER
echo $1
echo $BORDER
}

echo "Creating DNS zone: $DNS_ZONE_NAME"
ZONE_ID=$(oci dns zone create -c $COMPARTMENT_ID --zone-type PRIMARY --name $DNS_ZONE_NAME --raw-output --query 'data.id')
echo "Zone ID: $ZONE_ID"

# We will create a Steering Policy that is configured to load balance responses to DNS queries for A
# records across 3 servers with different weights. If you look at the file
# scripts/examples/dns_traffic_management_example/load_balance_answers_with_comments.json you'll see
# that we have 3 answers of rtype "A" listed. Note that the third answer has "isDisabled" set to
# "true".
#
# The Steering Policy has rules defined in
# scripts/examples/dns_traffic_management_example/load_balance_rules_with_comments.json:
#
# 1. FILTER rule: Used to remove manually disabled answers (like the third answer in our example).
#
# 2. WEIGHTED rule: Used to randomly shuffle the answers with the weight values assigned to each
# answer by name. A higher weight value will increase the probability of an answer being returned
# first in the list of answers.
#
# 3. LIMIT rule: Used to remove answers from the list until the number of answers left is less than
# or equal to the value defined in "defaultCount". For example, this means that we will only
# return 1 answer when we're done processing the policy.
echo "Creating a Traffic Management Steering Policy for load balancing"

# Use jsonlint to generate comment free JSON files since real JSON files cannot contains comments.
jsonlint -Sf scripts/examples/dns_traffic_management_example/load_balance_answers_with_comments.json > \
scripts/examples/dns_traffic_management_example/load_balance_answers.json
jsonlint -Sf scripts/examples/dns_traffic_management_example/load_balance_rules_with_comments.json > \
scripts/examples/dns_traffic_management_example/load_balance_rules.json

POLICY_ID=$(oci dns steering-policy create -c $COMPARTMENT_ID --display-name "$STEERING_POLICY_NAME" \
--template LOAD_BALANCE --ttl 30 \
--answers file://scripts/examples/dns_traffic_management_example/load_balance_answers.json \
--rules file://scripts/examples/dns_traffic_management_example/load_balance_rules.json \
--raw-output --query 'data.id')
echo "Steering Policy ID: $POLICY_ID"

# After we have a Steering Policy we have to create a Steering Policy Attachment to apply the policy
# to a domain within a zone.
echo "Attaching Steering Policy to domain: $DOMAIN_NAME"
ATTACHMENT_ID=$(oci dns steering-policy-attachment create --steering-policy-id $POLICY_ID --zone-id $ZONE_ID \
--domain-name "$DOMAIN_NAME" \
--raw-output --query 'data.id')
echo "Attachment ID: $ATTACHMENT_ID"

# At this point the policy has been applied to the specified domain and answers to DNS queries for
# A records at that domain will be computed using the policy.

# Clean up all the resources we created.
echo "Deleting Steering Policy Attachment: $ATTACHMENT_ID"
oci dns steering-policy-attachment delete --steering-policy-attachment-id $ATTACHMENT_ID --force

echo "Deleting Steering Policy: $POLICY_ID"
oci dns steering-policy delete --steering-policy-id $POLICY_ID --force

echo "Deleting DNS zone: $DNS_ZONE_NAME"
oci dns zone delete --zone-name-or-id $ZONE_ID --force

echo "SUCCESS"
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
// The first answer is an A record that points to the IPv4 address 1.2.3.4
{
"name": "Server 1",
"rtype": "A",
"rdata": "1.2.3.4"
},
// The second answer is an A record that points to the IPv4 address 2.3.4.5
{
"name": "Server 2",
"rtype": "A",
"rdata": "2.3.4.5"
},
// The third answer is an A record that points to the IPv4 address 3.4.5.6, but it is manually
// disabled.
{
"name": "Server 1",
"rtype": "A",
"rdata": "3.4.5.6",
"isDisabled": true
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[
{
/*
* The first rule in a LOAD_BALANCE policy template is a FILTER rule that only keeps answers
* that do not have their isDisabled property set to true. Answers without an isDisable property
* defined are kept.
*/
"ruleType": "FILTER",
"defaultAnswerData": [
{
"answerCondition": "answer.isDisabled != true",
"shouldKeep": true
}
]
},
/*
* If we need to remove answers for unhealthy hosts then we would define a health check monitor
* for the policy using the healthCheckMonitorId property in the steering policy details and the
* next rule would be a HEALTH rule:
* {
* "ruleType": "HEALTH"
* },
*/
{
/*
* The next rule in a LOAD_BALANCE policy template is a WEIGHTED rule where we define the
* weights for each answer by the answer's name property to determine how often an answer will
* be at the beginning of the list of answers in response to a DNS query. This rule is the main
* point of a LOAD_BALANCE policy.
*
* In this example, we want to return Server 1 first in the list three times as often as Server
* 2.
*/
"ruleType": "WEIGHTED",
"defaultAnswerData": [
{
"answerCondition": "answer.name == 'Server 1'",
"value": 75
},
{
"answerCondition": "answer.name == 'Server 2'",
"value": 25
},
{
"answerCondition": "answer.name == 'Server 3'",
"value": 1
}
]
},
{
/*
* The final rule in a LOAD_BALANCE policy template is a LIMIT rule that limits the number of
* answers returned in the response to a DNS query.
*/
"ruleType": "LIMIT",
"defaultCount": 1
}
]
87 changes: 59 additions & 28 deletions scripts/examples/email_example.sh
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
#!/bin/bash
# This script provides a basic example of how to use the Email Service in the Python SDK. This script accepts two
# will demonstrate:
#!/usr/bin/env bash
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
# This script provides a basic example of how to use the Email Service in the CLI.
# It will demonstrate:
#
# * Creating, retrieving, listing and deleting email senders
# * Creating, retrieving, listing and deleting email suppressions
# * Obtaining SMTP credentials for your IAM user so that you can send emails.
# See https://docs.us-phoenix-1.oraclecloud.com/Content/Email/Tasks/configuresmtpconnection.htm for more
# information on sending emails
# * Creating, retrieving, updating, listing, and deleting email senders
# * Creating, retrieving, listing, and deleting email suppressions
# * Creating, retrieving, listing, and deleting SMTP credentials
# See https://docs.cloud.oracle.com/iaas/Content/Email/Tasks/configuresmtpconnection.htm for more
# information on sending emails with your IAM user
#
# The following three variables must be populated at the top of this script:
# The following three variables must be populated from the environment:
#
# * The tenancy ID where the suppressions will be created
# * The compartment ID where email senders will be created
# * The User ID to create the SMTP credentials for
# * The address of the email sender
# * The address of the email suppression
# * TENANCY_ID: The tenancy ID where the suppressions will be created
# * COMPARTMENT_ID: The compartment ID where email senders will be created
# * USER_ID: The User ID to create the SMTP credentials for
#
# Note that email senders are created in the compartment which you specify, but the suppressions are always created at the tenancy
# level.
# This script will create and delete these resources:
#
# * SENDER_EMAIL_ADDRESS: The address of the approved sender
# * SUPPRESSION_EMAIL_ADDRESS: The address of the email suppression
# * an SMTP credential
#
# Note that email senders are created in the compartment which you specify, but suppressions
# are always created at the tenancy level.
#
# Requirements for running this script:
# - OCI CLI v2.4.19 or later (you can check this by running oci --version)
# - jq (https://stedolan.github.io/jq/) for JSON querying of CLI output. This may be a useful utility in general and may help cater to scenarios
# which can't be wholly addressed by the --query option in the CLI
# - OCI CLI v2.4.42 or later (you can check this by running oci --version)
# - region set in the ~/.oci/config DEFAULT profile
# - jq (https://stedolan.github.io/jq/) for JSON querying of CLI output. This useful utility may also
# be used to help cater to scenarios which can't be wholly addressed by the --query option in the CLI

set -e

TENANCY_ID=""
COMPARTMENT_ID=""
USER_ID=""
SENDER_EMAIL_ADDRESS="[email protected]"
SUPPRESSION_EMAIL_ADDRESS="[email protected]"
if [ "${TENANCY_ID}" == "" ]; then
echo $0: "TENANCY_ID must be defined in the environment"
exit 1
fi

if [ "${COMPARTMENT_ID}" == "" ]; then
echo $0: "COMPARTMENT_ID must be defined in the environment"
exit 1
fi

if [ "${USER_ID}" == "" ]; then
echo $0: "USER_ID must be defined in the environment"
exit 1
fi

readonly SENDER_EMAIL_ADDRESS="cli-example-sender-email-${RANDOM}@oracle.com"
readonly SUPPRESSION_EMAIL_ADDRESS="cli-example-suppression-email-${RANDOM}@oracle.com"

BORDER="=========================================="

Expand All @@ -40,27 +58,40 @@ function print_header() {
echo $BORDER
}

print_header "Sender Operations"
print_header "Approved Sender Operations"
echo "Creating sender and waiting for it to become active"
SENDER_ID=$(oci email sender create -c $COMPARTMENT_ID --email-address $SENDER_EMAIL_ADDRESS --wait-for-state ACTIVE --query 'data.id' --raw-output 2>/dev/null)
echo "Getting sender"
oci email sender get --sender-id $SENDER_ID
echo "Updating sender"
oci email sender update --sender-id $SENDER_ID --freeform-tags '{"Department": "Finance"}' --force
echo "Listing senders"
oci email sender list -c $COMPARTMENT_ID --all
echo "Deleting sender"
oci email sender delete --sender-id $SENDER_ID --force

print_header "Suppression Operations"
echo "Creating suppression"
SUPPRESSION_ID=$(oci email suppression create -c $TENANCY_ID --email-address $SUPPRESSION_EMAIL_ADDRESS --query 'data.id' --raw-output)
echo "Getting suppression"
oci email suppression get --suppression-id $SUPPRESSION_ID
oci email suppression list -c $TENANCY_ID --email-address $SUPPRESSION_EMAIL_ADDRESS --time-created-greater-than-or-equal-to 2018-03-10T00:00:00Z
echo "Listing suppressions"
oci email suppression list -c $TENANCY_ID --email-address $SUPPRESSION_EMAIL_ADDRESS --time-created-greater-than-or-equal-to 2019-01-10T00:00:00Z
echo "Deleting suppression"
oci email suppression delete --suppression-id $SUPPRESSION_ID --force

print_header "SMTP Credential operations"
print_header "SMTP Credential Operations"
echo "Creating SMTP credential"
SMTP_CREDENTIAL=$(oci iam smtp-credential create --user-id $USER_ID --description 'Example SMTP credential')
SMTP_CREDENTIAL_ID=$(jq -r '.data.id' <<< "$SMTP_CREDENTIAL")
SMTP_CREDENTIAL_USERNAME=$(jq -r '.data.username' <<< "$SMTP_CREDENTIAL")
SMTP_CREDENTIAL_PASSWORD=$(jq -r '.data.password' <<< "$SMTP_CREDENTIAL")
# The 'create' call is the only time the password for the credential will be returned
echo "SMTP Credential username: $SMTP_CREDENTIAL_USERNAME"
echo "SMTP Credential password: $SMTP_CREDENTIAL_PASSWORD"
echo "Listing SMTP credentials"
oci iam smtp-credential list --user-id $USER_ID
echo "Deleting SMTP credential"
oci iam smtp-credential delete --user-id $USER_ID --smtp-credential-id $SMTP_CREDENTIAL_ID --force

echo "Success!"
echo "Complete."
Loading

0 comments on commit edb6b69

Please sign in to comment.