Skip to content

Commit

Permalink
Releasing version 1.3.0 (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
mross22 authored Apr 6, 2017
1 parent a1ee832 commit eedac5e
Show file tree
Hide file tree
Showing 16 changed files with 333 additions and 71 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ 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.0 - 2017-04-06
====================

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

* Support for DHCP Search Domain Option.
* Support for ComputeClient.get_windows_instance_initial_credentials.

====================
1.2.0 - 2017-03-28
====================
Expand Down
37 changes: 37 additions & 0 deletions oraclebmc/core/compute_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,43 @@ def get_volume_attachment(self, volume_attachment_id, **kwargs):
header_params=header_params,
response_type="VolumeAttachment")

def get_windows_instance_initial_credentials(self, instance_id, **kwargs):
"""
GetWindowsInstanceInitialCredentials
Gets the generated credentials for the instance. Only works for Windows instances. The returned credentials
are only valid for the initial login.
:param str instance_id: (required)
The OCID of the instance.
:return: A Response object with data of type InstanceCredentials
:rtype: InstanceCredentials
"""
resource_path = "/instances/{instanceId}/initialCredentials"
method = "GET"

if kwargs:
raise ValueError(
"get_windows_instance_initial_credentials got unknown kwargs: {!r}".format(kwargs))

path_params = {
"instanceId": instance_id
}
path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing}

header_params = {
"accept": "application/json",
"content-type": "application/json"
}

return self.base_client.call_api(
resource_path=resource_path,
method=method,
path_params=path_params,
header_params=header_params,
response_type="InstanceCredentials")

def instance_action(self, instance_id, action, **kwargs):
"""
InstanceAction
Expand Down
4 changes: 4 additions & 0 deletions oraclebmc/core/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from .dhcp_dns_option import DhcpDnsOption
from .dhcp_option import DhcpOption
from .dhcp_options import DhcpOptions
from .dhcp_search_domain_option import DhcpSearchDomainOption
from .drg import Drg
from .drg_attachment import DrgAttachment
from .egress_security_rule import EgressSecurityRule
Expand All @@ -35,6 +36,7 @@
from .image import Image
from .ingress_security_rule import IngressSecurityRule
from .instance import Instance
from .instance_credentials import InstanceCredentials
from .internet_gateway import InternetGateway
from .launch_instance_details import LaunchInstanceDetails
from .port_range import PortRange
Expand Down Expand Up @@ -91,6 +93,7 @@
"DhcpDnsOption": DhcpDnsOption,
"DhcpOption": DhcpOption,
"DhcpOptions": DhcpOptions,
"DhcpSearchDomainOption": DhcpSearchDomainOption,
"Drg": Drg,
"DrgAttachment": DrgAttachment,
"EgressSecurityRule": EgressSecurityRule,
Expand All @@ -102,6 +105,7 @@
"Image": Image,
"IngressSecurityRule": IngressSecurityRule,
"Instance": Instance,
"InstanceCredentials": InstanceCredentials,
"InternetGateway": InternetGateway,
"LaunchInstanceDetails": LaunchInstanceDetails,
"PortRange": PortRange,
Expand Down
26 changes: 10 additions & 16 deletions oraclebmc/core/models/create_subnet_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,22 +179,19 @@ def dns_label(self):
Gets the dns_label of this CreateSubnetDetails.
A DNS label for the subnet, used in conjunction with the VNIC's hostname and
VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC
within this subnet (e.g., `bminstance-1.subnet-123.vcn-1.oraclevcn.com`).
Must be unique within the VCN and comply with
`RFC 952`__ and
`RFC 1123`__. The value cannot be changed.
within this subnet (e.g., `bminstance-1.subnet123.vcn1.oraclevcn.com`).
Must be an alphanumeric string that begins with a letter and is unique within the VCN.
The value cannot be changed.
This value must be set if you want to use the VCN Resolver to resolve the
This value must be set if you want to use the Internet and VCN Resolver to resolve the
hostnames of instances in the subnet. It can only be set if the VCN itself
was created with a DNS label.
For more information, see
`DNS in Your Virtual Cloud Network`__.
Example: `subnet-123`
Example: `subnet123`
__ https://tools.ietf.org/html/rfc952
__ https://tools.ietf.org/html/rfc1123
__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
Expand All @@ -209,22 +206,19 @@ def dns_label(self, dns_label):
Sets the dns_label of this CreateSubnetDetails.
A DNS label for the subnet, used in conjunction with the VNIC's hostname and
VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC
within this subnet (e.g., `bminstance-1.subnet-123.vcn-1.oraclevcn.com`).
Must be unique within the VCN and comply with
`RFC 952`__ and
`RFC 1123`__. The value cannot be changed.
within this subnet (e.g., `bminstance-1.subnet123.vcn1.oraclevcn.com`).
Must be an alphanumeric string that begins with a letter and is unique within the VCN.
The value cannot be changed.
This value must be set if you want to use the VCN Resolver to resolve the
This value must be set if you want to use the Internet and VCN Resolver to resolve the
hostnames of instances in the subnet. It can only be set if the VCN itself
was created with a DNS label.
For more information, see
`DNS in Your Virtual Cloud Network`__.
Example: `subnet-123`
Example: `subnet123`
__ https://tools.ietf.org/html/rfc952
__ https://tools.ietf.org/html/rfc1123
__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
Expand Down
30 changes: 14 additions & 16 deletions oraclebmc/core/models/create_vcn_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,22 +110,21 @@ def dns_label(self):
Gets the dns_label of this CreateVcnDetails.
A DNS label for the VCN, used in conjunction with the VNIC's hostname and
subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC
within this subnet (e.g., `bminstance-1.subnet-123.vcn-1.oraclevcn.com`).
within this subnet (e.g., `bminstance-1.subnet123.vcn1.oraclevcn.com`).
Not required to be unique, but it's a best practice to set unique DNS labels
for VCNs in your tenancy. Must comply with
`RFC 952`__ and
`RFC 1123`__. The value cannot be changed.
for VCNs in your tenancy.
Must be an alphanumeric string that begins with a letter.
The value cannot be changed.
You must set this value if you want instances to be able to use hostnames to
resolve other instances in the VCN. Otherwise the VCN Resolver will not work.
resolve other instances in the VCN. Otherwise the Internet and VCN Resolver
will not work.
For more information, see
`DNS in Your Virtual Cloud Network`__.
Example: `vcn-1`
Example: `vcn1`
__ https://tools.ietf.org/html/rfc952
__ https://tools.ietf.org/html/rfc1123
__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
Expand All @@ -140,22 +139,21 @@ def dns_label(self, dns_label):
Sets the dns_label of this CreateVcnDetails.
A DNS label for the VCN, used in conjunction with the VNIC's hostname and
subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC
within this subnet (e.g., `bminstance-1.subnet-123.vcn-1.oraclevcn.com`).
within this subnet (e.g., `bminstance-1.subnet123.vcn1.oraclevcn.com`).
Not required to be unique, but it's a best practice to set unique DNS labels
for VCNs in your tenancy. Must comply with
`RFC 952`__ and
`RFC 1123`__. The value cannot be changed.
for VCNs in your tenancy.
Must be an alphanumeric string that begins with a letter.
The value cannot be changed.
You must set this value if you want instances to be able to use hostnames to
resolve other instances in the VCN. Otherwise the VCN Resolver will not work.
resolve other instances in the VCN. Otherwise the Internet and VCN Resolver
will not work.
For more information, see
`DNS in Your Virtual Cloud Network`__.
Example: `vcn-1`
Example: `vcn1`
__ https://tools.ietf.org/html/rfc952
__ https://tools.ietf.org/html/rfc1123
__ {{DOC_SERVER_URL}}/Content/Network/Concepts/dns.htm
Expand Down
22 changes: 14 additions & 8 deletions oraclebmc/core/models/dhcp_dns_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ def server_type(self):
- **VcnLocalPlusInternet:** Also referred to as \"Internet and VCN Resolver\".
Instances can resolve internet hostnames (no Internet Gateway is required),
and can resolve hostnames of instances in the VCN. This is the default
value in the default set of DHCP options in the VCN. For the VCN Resolver to
work across the VCN, there must also be a DNS label set for the VCN, a DNS
label set for each subnet, and a hostname for each instance. For more information,
see `DNS in Your Virtual Cloud Network`__.
value in the default set of DHCP options in the VCN. For the Internet and
VCN Resolver to work across the VCN, there must also be a DNS label set for
the VCN, a DNS label set for each subnet, and a hostname for each instance.
The Internet and VCN Resolver also enables reverse DNS lookup, which lets
you determine the hostname corresponding to the private IP address. For more
information, see
`DNS in Your Virtual Cloud Network`__.
- **CustomDnsServer:** Instances use a DNS server of your choice (three maximum).
Expand All @@ -85,10 +88,13 @@ def server_type(self, server_type):
- **VcnLocalPlusInternet:** Also referred to as \"Internet and VCN Resolver\".
Instances can resolve internet hostnames (no Internet Gateway is required),
and can resolve hostnames of instances in the VCN. This is the default
value in the default set of DHCP options in the VCN. For the VCN Resolver to
work across the VCN, there must also be a DNS label set for the VCN, a DNS
label set for each subnet, and a hostname for each instance. For more information,
see `DNS in Your Virtual Cloud Network`__.
value in the default set of DHCP options in the VCN. For the Internet and
VCN Resolver to work across the VCN, there must also be a DNS label set for
the VCN, a DNS label set for each subnet, and a hostname for each instance.
The Internet and VCN Resolver also enables reverse DNS lookup, which lets
you determine the hostname corresponding to the private IP address. For more
information, see
`DNS in Your Virtual Cloud Network`__.
- **CustomDnsServer:** Instances use a DNS server of your choice (three maximum).
Expand Down
13 changes: 9 additions & 4 deletions oraclebmc/core/models/dhcp_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@ def get_subtype(object_dictionary):

if type == 'DomainNameServer':
return 'DhcpDnsOption'

if type == 'SearchDomain':
return 'DhcpSearchDomainOption'
else:
return 'DhcpOption'

@property
def type(self):
"""
Gets the type of this DhcpOption.
The specific DHCP option. `DomainNameServer`
(for :class:`DhcpDnsOption`).
The specific DHCP option. Either `DomainNameServer`
(for :class:`DhcpDnsOption`) or
`SearchDomain` (for :class:`DhcpSearchDomainOption`).
:return: The type of this DhcpOption.
Expand All @@ -49,8 +53,9 @@ def type(self):
def type(self, type):
"""
Sets the type of this DhcpOption.
The specific DHCP option. `DomainNameServer`
(for :class:`DhcpDnsOption`).
The specific DHCP option. Either `DomainNameServer`
(for :class:`DhcpDnsOption`) or
`SearchDomain` (for :class:`DhcpSearchDomainOption`).
:param type: The type of this DhcpOption.
Expand Down
92 changes: 92 additions & 0 deletions oraclebmc/core/models/dhcp_search_domain_option.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# coding: utf-8
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.

from .dhcp_option import DhcpOption
from ...util import formatted_flat_dict


class DhcpSearchDomainOption(DhcpOption):

def __init__(self):

self.swagger_types = {
'type': 'str',
'search_domain_names': 'list[str]'
}

self.attribute_map = {
'type': 'type',
'search_domain_names': 'searchDomainNames'
}

self._type = None
self._search_domain_names = None
self._type = 'SearchDomain'

@property
def search_domain_names(self):
"""
Gets the search_domain_names of this DhcpSearchDomainOption.
A single search domain name according to `RFC 952`__
and `RFC 1123`__. During a DNS query,
the OS will append this search domain name to the value being queried, but only if
that value is not a fully qualified domain name (FQDN).
If you set :class:`DhcpDnsOption` to `VcnLocalPlusInternet`,
and you assign a DNS label to the VCN during creation, the search domain name in the
VCN's default set of DHCP options is automatically set to the VCN domain
(e.g., `vcn1.oraclevcn.com`).
If you don't want to use a search domain name, omit this option from the
set of DHCP options. Do not include this option with an empty list
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
:return: The search_domain_names of this DhcpSearchDomainOption.
:rtype: list[str]
"""
return self._search_domain_names

@search_domain_names.setter
def search_domain_names(self, search_domain_names):
"""
Sets the search_domain_names of this DhcpSearchDomainOption.
A single search domain name according to `RFC 952`__
and `RFC 1123`__. During a DNS query,
the OS will append this search domain name to the value being queried, but only if
that value is not a fully qualified domain name (FQDN).
If you set :class:`DhcpDnsOption` to `VcnLocalPlusInternet`,
and you assign a DNS label to the VCN during creation, the search domain name in the
VCN's default set of DHCP options is automatically set to the VCN domain
(e.g., `vcn1.oraclevcn.com`).
If you don't want to use a search domain name, omit this option from the
set of DHCP options. Do not include this option with an empty list
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
:param search_domain_names: The search_domain_names of this DhcpSearchDomainOption.
:type: list[str]
"""
self._search_domain_names = search_domain_names

def __repr__(self):
return formatted_flat_dict(self)

def __eq__(self, other):
if other is None:
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
return not self == other
10 changes: 10 additions & 0 deletions oraclebmc/core/models/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ def ipxe_script(self):
following iSCSI IP address: 169.254.0.2, and boot volume IQN:
iqn.2015-02.oracle.boot.
For more information about the Bring Your Own Image feature of
Oracle Bare Metal Cloud Services, see [Bring Your Own Custom
Image: RHEL 7.x & Derivatives (CentOS, Oracle Linux)]
(/Content/General/Reference/aqswhitepapers.htm).
For more information about iPXE, see http://ipxe.org.
Expand Down Expand Up @@ -229,6 +234,11 @@ def ipxe_script(self, ipxe_script):
following iSCSI IP address: 169.254.0.2, and boot volume IQN:
iqn.2015-02.oracle.boot.
For more information about the Bring Your Own Image feature of
Oracle Bare Metal Cloud Services, see [Bring Your Own Custom
Image: RHEL 7.x & Derivatives (CentOS, Oracle Linux)]
(/Content/General/Reference/aqswhitepapers.htm).
For more information about iPXE, see http://ipxe.org.
Expand Down
Loading

0 comments on commit eedac5e

Please sign in to comment.