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
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.

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

====================
1.3.3 - 2017-06-09
====================

-------
Added
-------

* An UploadManager class to better support large object uploads though multipart and parallel operations.
* Support for object storage pre-authenticated requests and public buckets.
* Support for load balancing service.
* Support for nested instance metadata operations.

====================
1.3.2 - 2017-05-18
====================
Expand Down
22 changes: 22 additions & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,27 @@ Virtual Network

.. automodule:: oraclebmc.identity.models
:members:
:undoc-members:
:imported-members:

==============
Load Balancer
==============

--------
Client
--------

.. autoclass:: oraclebmc.loadbalancer.load_balancer_client.LoadBalancerClient
:members:

--------
Models
--------

.. automodule:: oraclebmc.loadbalancer.models
:members:
:undoc-members:
:imported-members:

================
Expand All @@ -76,6 +97,7 @@ Virtual Network

.. automodule:: oraclebmc.object_storage.models
:members:
:undoc-members:
:imported-members:


Expand Down
57 changes: 57 additions & 0 deletions examples/multipart_object_upload.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.

from __future__ import print_function
import os
import oraclebmc
from oraclebmc.object_storage import UploadManager
from oraclebmc.object_storage.models import CreateBucketDetails
from oraclebmc.object_storage.transfer.constants import MEBIBYTE


def progress_callback(bytes_uploaded):
print("{} additional bytes uploaded".format(bytes_uploaded))


config = oraclebmc.config.from_file()
compartment_id = config["tenancy"]
object_storage = oraclebmc.object_storage.ObjectStorageClient(config)

namespace = object_storage.get_namespace().data
bucket_name = "python-sdk-example-bucket"
object_name = "python-sdk-example-object"

print("Creating a new bucket {!r} in compartment {!r}".format(bucket_name, compartment_id))
request = CreateBucketDetails()
request.compartment_id = compartment_id
request.name = bucket_name
bucket = object_storage.create_bucket(namespace, request)

# create example file to upload
filename = 'multipart_object_content.txt'
file_size_in_mebibytes = 10
sample_content = b'a'
with open(filename, 'wb') as f:
while f.tell() < MEBIBYTE * file_size_in_mebibytes:
f.write(sample_content * MEBIBYTE)

print("Uploading new object {!r}".format(object_name))

# upload manager will automatically use mutlipart uploads if the part size is less than the file size
part_size = 2 * MEBIBYTE # part size (in bytes)
upload_manager = UploadManager(object_storage, allow_parallel_uploads=True, parallel_process_count=3)
response = upload_manager.upload_file(
namespace, bucket_name, object_name, filename, part_size=part_size, progress_callback=progress_callback)

# To force single part uploads, set "allow_multipart_uploads=False" when creating the UploadManager.
# upload_manager = UploadManager(object_storage, allow_multipart_uploads=False)
# response = upload_manager.upload_file(
# namespace, bucket_name, object_name, filename, part_size=part_size, progress_callback=progress_callback)

# remove file to clean up
os.remove(filename)

print("Deleting object {}".format(object_name))
object_storage.delete_object(namespace, bucket_name, object_name)

print("Deleting bucket {}".format(bucket_name))
object_storage.delete_bucket(namespace, bucket_name)
2 changes: 1 addition & 1 deletion examples/parallel_upload_to_object_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def upload_to_object_storage(config, namespace, bucket, path):
"parallel. The example uses multiple processes.",
"",
"All the files in 'directory' will be uploaded to the object storage bucket",
"specified by 'bucket_name' The default profile will is used.",
"specified by 'bucket_name' The default profile is used.",
"",
"The bucket must already exist. See object_crud.py for a bucket creation",
"example."])
Expand Down
10 changes: 5 additions & 5 deletions oraclebmc/core/blockstorage_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def create_volume(self, create_volume_details, **kwargs):
You may optionally specify a *display name* for the volume, which is simply a friendly name or
description. It does not have to be unique, and you can change it.

__ {{DOC_SERVER_URL}}/Content/Block/Concepts/overview.htm
__ {{DOC_SERVER_URL}}/Content/Identity/Concepts/overview.htm
__ {{DOC_SERVER_URL}}/Content/General/Concepts/regions.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Concepts/overview.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm


:param CreateVolumeDetails create_volume_details: (required)
Expand Down Expand Up @@ -97,7 +97,7 @@ def create_volume_backup(self, create_volume_backup_details, **kwargs):
When the data is imaged, it goes into a CREATING state.
After the backup is fully uploaded to the cloud, it goes into an AVAILABLE state.

__ {{DOC_SERVER_URL}}/Content/Block/Concepts/blockvolumebackups.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Concepts/blockvolumebackups.htm


:param CreateVolumeBackupDetails create_volume_backup_details: (required)
Expand Down Expand Up @@ -147,7 +147,7 @@ def delete_volume(self, volume_id, **kwargs):
`Disconnecting From a Volume`__.
**Warning:** All data on the volume will be permanently lost when the volume is deleted.

__ {{DOC_SERVER_URL}}/Content/Block/Tasks/disconnectingfromavolume.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Block/Tasks/disconnectingfromavolume.htm


:param str volume_id: (required)
Expand Down
10 changes: 5 additions & 5 deletions oraclebmc/core/compute_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def create_image(self, create_image_details, **kwargs):
You may optionally specify a *display name* for the image, which is simply a friendly name or description.
It does not have to be unique, and you can change it. See :func:`update_image`.

__ {{DOC_SERVER_URL}}/Content/Compute/Tasks/managingcustomimages.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/managingcustomimages.htm


:param CreateImageDetails create_image_details: (required)
Expand Down Expand Up @@ -679,9 +679,9 @@ def launch_instance(self, launch_instance_details, **kwargs):
operation to get the VNIC ID for the instance, and then call
:func:`get_vnic` with the VNIC ID.

__ {{DOC_SERVER_URL}}/Content/Compute/Concepts/computeoverview.htm
__ {{DOC_SERVER_URL}}/Content/Identity/Concepts/overview.htm
__ {{DOC_SERVER_URL}}/Content/General/Concepts/regions.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Concepts/computeoverview.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm


:param LaunchInstanceDetails launch_instance_details: (required)
Expand Down Expand Up @@ -794,7 +794,7 @@ def list_images(self, compartment_id, **kwargs):
information about images, see
`Managing Custom Images`__.

__ {{DOC_SERVER_URL}}/Content/Compute/Tasks/managingcustomimages.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Compute/Tasks/managingcustomimages.htm


:param str compartment_id: (required)
Expand Down
4 changes: 2 additions & 2 deletions oraclebmc/core/models/create_subnet_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def dns_label(self):

Example: `subnet123`

__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm


:return: The dns_label of this CreateSubnetDetails.
Expand All @@ -222,7 +222,7 @@ def dns_label(self, dns_label):

Example: `subnet123`

__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm


:param dns_label: The dns_label of this CreateSubnetDetails.
Expand Down
4 changes: 2 additions & 2 deletions oraclebmc/core/models/create_vcn_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def dns_label(self):

Example: `vcn1`

__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm


:return: The dns_label of this CreateVcnDetails.
Expand Down Expand Up @@ -154,7 +154,7 @@ def dns_label(self, dns_label):

Example: `vcn1`

__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm


:param dns_label: The dns_label of this CreateVcnDetails.
Expand Down
4 changes: 2 additions & 2 deletions oraclebmc/core/models/create_virtual_circuit_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def type(self):
means `RFC 1918`__ addresses
(10.0.0.0/8, 172.16/12, and 192.168/16). Only PRIVATE is supported.

__ https://tools.ietf.org/html/rfc1918
__ https://tools.ietf.org/html/rfc1918

Allowed values for this property are: "PUBLIC", "PRIVATE"

Expand All @@ -318,7 +318,7 @@ def type(self, type):
means `RFC 1918`__ addresses
(10.0.0.0/8, 172.16/12, and 192.168/16). Only PRIVATE is supported.

__ https://tools.ietf.org/html/rfc1918
__ https://tools.ietf.org/html/rfc1918


:param type: The type of this CreateVirtualCircuitDetails.
Expand Down
12 changes: 6 additions & 6 deletions oraclebmc/core/models/create_vnic_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ def hostname_label(self):

Example: `bminstance-1`

__ https://tools.ietf.org/html/rfc952
__ https://tools.ietf.org/html/rfc1123
__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
__ https://tools.ietf.org/html/rfc952
__ https://tools.ietf.org/html/rfc1123
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm


:return: The hostname_label of this CreateVnicDetails.
Expand Down Expand Up @@ -153,9 +153,9 @@ def hostname_label(self, hostname_label):

Example: `bminstance-1`

__ https://tools.ietf.org/html/rfc952
__ https://tools.ietf.org/html/rfc1123
__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
__ https://tools.ietf.org/html/rfc952
__ https://tools.ietf.org/html/rfc1123
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm


:param hostname_label: The hostname_label of this CreateVnicDetails.
Expand Down
4 changes: 2 additions & 2 deletions oraclebmc/core/models/dhcp_dns_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def server_type(self):

- **CustomDnsServer:** Instances use a DNS server of your choice (three maximum).

__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm

Allowed values for this property are: "VcnLocal", "VcnLocalPlusInternet", "CustomDnsServer", 'UNKNOWN_ENUM_VALUE'.
Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
Expand Down Expand Up @@ -101,7 +101,7 @@ def server_type(self, server_type):

- **CustomDnsServer:** Instances use a DNS server of your choice (three maximum).

__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
__ https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm


:param server_type: The server_type of this DhcpDnsOption.
Expand Down
8 changes: 4 additions & 4 deletions oraclebmc/core/models/dhcp_search_domain_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def search_domain_names(self):
of search domain names, or with an empty string as the value for any search
domain name.

__ https://tools.ietf.org/html/rfc952
__ https://tools.ietf.org/html/rfc1123
__ https://tools.ietf.org/html/rfc952
__ https://tools.ietf.org/html/rfc1123


:return: The search_domain_names of this DhcpSearchDomainOption.
Expand All @@ -68,8 +68,8 @@ def search_domain_names(self, search_domain_names):
of search domain names, or with an empty string as the value for any search
domain name.

__ https://tools.ietf.org/html/rfc952
__ https://tools.ietf.org/html/rfc1123
__ https://tools.ietf.org/html/rfc952
__ https://tools.ietf.org/html/rfc1123


:param search_domain_names: The search_domain_names of this DhcpSearchDomainOption.
Expand Down
8 changes: 4 additions & 4 deletions oraclebmc/core/models/egress_security_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def icmp_options(self):
Unreachable\") code 4 (\"Fragmentation Needed and Don't Fragment was Set\"). If you need to specify
multiple codes for a single type, create a separate security list rule for each.

__ http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml
__ http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml


:return: The icmp_options of this EgressSecurityRule.
Expand All @@ -94,7 +94,7 @@ def icmp_options(self, icmp_options):
Unreachable\") code 4 (\"Fragmentation Needed and Don't Fragment was Set\"). If you need to specify
multiple codes for a single type, create a separate security list rule for each.

__ http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml
__ http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml


:param icmp_options: The icmp_options of this EgressSecurityRule.
Expand Down Expand Up @@ -143,7 +143,7 @@ def protocol(self):
`Protocol Numbers`__.
Options are supported only for ICMP (\"1\"), TCP (\"6\"), and UDP (\"17\").

__ http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
__ http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml


:return: The protocol of this EgressSecurityRule.
Expand All @@ -160,7 +160,7 @@ def protocol(self, protocol):
`Protocol Numbers`__.
Options are supported only for ICMP (\"1\"), TCP (\"6\"), and UDP (\"17\").

__ http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
__ http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml


:param protocol: The protocol of this EgressSecurityRule.
Expand Down
8 changes: 4 additions & 4 deletions oraclebmc/core/models/ingress_security_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def icmp_options(self):
Unreachable\") code 4 (\"Fragmentation Needed and Don't Fragment was Set\"). If you need to specify
multiple codes for a single type, create a separate security list rule for each.

__ http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml
__ http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml


:return: The icmp_options of this IngressSecurityRule.
Expand All @@ -68,7 +68,7 @@ def icmp_options(self, icmp_options):
Unreachable\") code 4 (\"Fragmentation Needed and Don't Fragment was Set\"). If you need to specify
multiple codes for a single type, create a separate security list rule for each.

__ http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml
__ http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml


:param icmp_options: The icmp_options of this IngressSecurityRule.
Expand Down Expand Up @@ -117,7 +117,7 @@ def protocol(self):
`Protocol Numbers`__.
Options are supported only for ICMP (\"1\"), TCP (\"6\"), and UDP (\"17\").

__ http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
__ http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml


:return: The protocol of this IngressSecurityRule.
Expand All @@ -134,7 +134,7 @@ def protocol(self, protocol):
`Protocol Numbers`__.
Options are supported only for ICMP (\"1\"), TCP (\"6\"), and UDP (\"17\").

__ http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
__ http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml


:param protocol: The protocol of this IngressSecurityRule.
Expand Down
Loading